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