2 implementations of GetMetadataForType
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelMetadata.cs (1)
814public virtual ModelMetadata GetMetadataForType(Type modelType)
ModelBinding\ModelMetadataProvider.cs (1)
25public abstract ModelMetadata GetMetadataForType(Type modelType);
102 references to GetMetadataForType
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
ApiResponseTypeProvider.cs (1)
304apiResponse.ModelMetadata = modelMetadataProvider?.GetMetadataForType(responseType);
DefaultApiDescriptionProvider.cs (1)
185metadata = _modelMetadataProvider.GetMetadataForType(actionParameter.ParameterType);
Microsoft.AspNetCore.Mvc.Core (11)
ApplicationModels\InferParameterBindingInfoConvention.cs (1)
175metadata = _modelMetadataProvider.GetMetadataForType(parameter.ParameterInfo.ParameterType);
Controllers\ControllerBinderDelegateProvider.cs (1)
146metadata = modelMetadataProvider.GetMetadataForType(parameter.ParameterType);
ModelBinding\Binders\CollectionModelBinderProvider.cs (1)
58var elementBinder = context.CreateBinder(context.MetadataProvider.GetMetadataForType(elementType));
ModelBinding\Binders\KeyValuePairModelBinderProvider.cs (2)
27var keyMetadata = context.MetadataProvider.GetMetadataForType(typeArguments[0]); 30var valueMetadata = context.MetadataProvider.GetMetadataForType(typeArguments[1]);
ModelBinding\Metadata\DefaultModelMetadata.cs (2)
222_elementMetadata = _provider.GetMetadataForType(ElementType); 561return _provider.GetMetadataForType(modelType);
ModelBinding\ModelBindingHelper.cs (2)
232var modelMetadata = metadataProvider.GetMetadataForType(modelType); 374ClearValidationStateForModel(metadataProvider.GetMetadataForType(modelType), modelState, modelKey);
ModelBinding\ModelMetadataProviderExtensions.cs (1)
32var containerMetadata = provider.GetMetadataForType(containerType);
ModelBinding\ObjectModelValidator.cs (1)
51var metadata = model == null ? null : _modelMetadataProvider.GetMetadataForType(model.GetType());
Microsoft.AspNetCore.Mvc.Core.Test (11)
Controllers\ControllerBinderDelegateProviderTest.cs (1)
348.Setup(p => p.GetMetadataForType(typeof(Person)))
ModelBinding\Binders\BodyModelBinderTests.cs (1)
697ModelMetadata = metadataProvider.GetMetadataForType(modelType),
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
1124return _metadataProvider.GetMetadataForType(type);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (1)
1288return _metadataProvider.GetMetadataForType(type);
ModelBinding\Metadata\DefaultModelMetadataTest.cs (4)
955.Setup(mp => mp.GetMetadataForType(typeof(string))) 1242.Setup(mp => mp.GetMetadataForType(modelType)) 1271.Setup(mp => mp.GetMetadataForType(modelType)) 1314.Setup(mp => mp.GetMetadataForType(modelType))
ModelBinding\ParameterBinderTest.cs (2)
748.Setup(o => o.GetMetadataForType(typeof(Person))) 791.Setup(o => o.GetMetadataForType(typeof(Person)))
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (1)
63var metadata = TestModelMetadataProvider.CreateDefaultProvider(new List<IMetadataDetailsProvider> { new TestValidationModelNameProvider() }).GetMetadataForType(typeof(Person));
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (29)
DataAnnotationsClientModelValidatorProviderTest.cs (1)
123var metadata = _metadataProvider.GetMetadataForType(typeof(DummyClassWithDummyValidationAttribute));
DataAnnotationsModelValidatorProviderTest.cs (3)
25var metadata = _metadataProvider.GetMetadataForType(mockValidatable.GetType()); 67var metadata = _metadataProvider.GetMetadataForType(typeof(DummyClassWithDummyValidationAttribute)); 99var metadata = _metadataProvider.GetMetadataForType(mockValidatable.Object.GetType());
DataTypeClientModelValidatorProviderTest.cs (3)
24var metadata = _metadataProvider.GetMetadataForType(modelType); 41var metadata = _metadataProvider.GetMetadataForType(typeof(float)); 72var metadata = _metadataProvider.GetMetadataForType(modelType);
ModelMetadataProviderTest.cs (22)
29var metadata = provider.GetMetadataForType(type); 54var metadata = provider.GetMetadataForType(type); 91var metadata = provider.GetMetadataForType(modelType: typeof(ClassWithHiddenProperties)); 106var metadata = provider.GetMetadataForType(typeof(ClassWithHiddenProperties)); 121var metadata = provider.GetMetadataForType(typeof(ClassWithHiddenProperties)); 136var metadata = provider.GetMetadataForType(typeof(ClassWithHiddenProperties)); 230var metadata = provider.GetMetadataForType(typeof(string)); 246var metadata = provider.GetMetadataForType(typeof(string)); 399var metadata = provider.GetMetadataForType(typeof(string)); 415var metadata = provider.GetMetadataForType(typeof(string)); 431var metadata = provider.GetMetadataForType(typeof(string)); 451var metadata = provider.GetMetadataForType(typeof(string)); 477var metadata = provider.GetMetadataForType(typeof(string)); 499var metadata = provider.GetMetadataForType(typeof(string)); 516var metadata = provider.GetMetadataForType(typeof(string)); 534var metadata = provider.GetMetadataForType(typeof(string)); 552var metadata = provider.GetMetadataForType(typeof(string)); 575var metadata = provider.GetMetadataForType(typeof(string)); 593var metadata = provider.GetMetadataForType(typeof(string)); 615var metadata = provider.GetMetadataForType(typeof(string)); 634var metadata = provider.GetMetadataForType(typeof(string)); 653var metadata = provider.GetMetadataForType(typeof(string));
Microsoft.AspNetCore.Mvc.IntegrationTests (19)
ArrayModelBinderIntegrationTest.cs (1)
394var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType);
CollectionModelBinderIntegrationTest.cs (6)
991var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1020var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1077var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1115var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1143var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1192var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType);
ComplexRecordIntegrationTest.cs (5)
3319var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3348var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3389var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3423var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 4243return context.MetadataProvider.GetMetadataForType(parameter.ParameterType);
ComplexTypeIntegrationTestBase.cs (5)
3554var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3593var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3640var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3692var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3742return context.MetadataProvider.GetMetadataForType(parameter.ParameterType);
DictionaryModelBinderIntegrationTest.cs (1)
1220var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType);
ParameterBinderExtensions.cs (1)
49metadata = modelMetadataProvider.GetMetadataForType(parameter.ParameterType);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
JsonPatchOperationsArrayProvider.cs (1)
47parameterDescription.ModelMetadata = _modelMetadataProvider.GetMetadataForType(typeof(Operation[]));
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\PageBinderFactory.cs (1)
112metadata = modelMetadataProvider.GetMetadataForType(parameter.ParameterType);
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
InputTagHelperTest.cs (1)
2400var containerMetadata = metadataProvider.GetMetadataForType(containerType);
Microsoft.AspNetCore.Mvc.ViewFeatures (15)
DefaultDisplayTemplates.cs (2)
98elementMetadata = metadataProvider.GetMetadataForType(typeof(string)); 117itemMetadata = metadataProvider.GetMetadataForType(item.GetType());
DefaultEditorTemplates.cs (2)
80elementMetadata = metadataProvider.GetMetadataForType(typeof(string)); 99itemMetadata = metadataProvider.GetMetadataForType(item.GetType());
ExpressionMetadataProvider.cs (5)
102metadata = metadataProvider.GetMetadataForType(containerType).Properties[propertyName]; 117metadata = metadataProvider.GetMetadataForType(typeof(TResult)); 176var containerMetadata = metadataProvider.GetMetadataForType(viewDataInfo.Container.GetType()); 185var valueMetadata = metadataProvider.GetMetadataForType(viewDataInfo.Value.GetType()); 191var stringMetadata = metadataProvider.GetMetadataForType(typeof(string));
HtmlHelper.cs (2)
369var metadata = MetadataProvider.GetMetadataForType(type); 387var metadata = MetadataProvider.GetMetadataForType(enumType);
ModelExplorer.cs (3)
320var metadata = _metadataProvider.GetMetadataForType(modelType); 369var metadata = _metadataProvider.GetMetadataForType(modelType); 404metadata = _metadataProvider.GetMetadataForType(ModelType);
ModelMetadataProviderExtensions.cs (1)
31var modelMetadata = provider.GetMetadataForType(modelType);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (12)
Rendering\HtmlHelperNameExtensionsTest.cs (4)
167.Setup(m => m.GetMetadataForType(typeof(DefaultTemplatesUtilities.ObjectTemplateModel))) 183m => m.GetMetadataForType(typeof(DefaultTemplatesUtilities.ObjectTemplateModel)), 196.Setup(m => m.GetMetadataForType(typeof(DefaultTemplatesUtilities.ObjectTemplateModel))) 210m => m.GetMetadataForType(typeof(DefaultTemplatesUtilities.ObjectTemplateModel)),
ViewDataDictionaryTest.cs (8)
53.Setup(m => m.GetMetadataForType(typeof(object))) 63metadataProvider.Verify(m => m.GetMetadataForType(typeof(object)), Times.Once()); 72.Setup(m => m.GetMetadataForType(typeof(TestModel))) 83metadataProvider.Verify(m => m.GetMetadataForType(typeof(TestModel)), Times.Once()); 92.Setup(m => m.GetMetadataForType(typeof(object))) 96.Setup(m => m.GetMetadataForType(typeof(TestModel))) 109metadataProvider.Verify(m => m.GetMetadataForType(typeof(object)), Times.Once()); 112metadataProvider.Verify(m => m.GetMetadataForType(typeof(TestModel)), Times.Once());