163 references to GetMetadataForProperty
Microsoft.AspNetCore.Mvc.Abstractions.Test (11)
ModelBinding\ModelStateDictionaryTest.cs (11)
327
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
757
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
816
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
860
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
890
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
918
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
980
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
1004
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
1094
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
1119
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
1194
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
DefaultApiDescriptionProvider.cs (1)
201
var modelMetadata = context.MetadataProvider.
GetMetadataForProperty
(
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (2)
2080
description.ModelMetadata = modelMetadataProvider.
GetMetadataForProperty
(typeof(Person), nameof(Person.Name));
2131
description.ModelMetadata = modelMetadataProvider.
GetMetadataForProperty
(typeof(Person), nameof(Person.Name));
Microsoft.AspNetCore.Mvc.Core (2)
ApplicationModels\DefaultApplicationModelProvider.cs (1)
219
var modelMetadata = _modelMetadataProvider.
GetMetadataForProperty
(declaringType, propertyInfo.Name);
Controllers\ControllerBinderDelegateProvider.cs (1)
178
var metadata = modelMetadataProvider.
GetMetadataForProperty
(controllerType, property.Name);
Microsoft.AspNetCore.Mvc.Core.Test (39)
ModelBinding\Binders\ArrayModelBinderProviderTest.cs (1)
81
var modelMetadata = metadataProvider.
GetMetadataForProperty
(
ModelBinding\Binders\ArrayModelBinderTest.cs (3)
24
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
151
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
198
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
ModelBinding\Binders\CollectionModelBinderTest.cs (2)
407
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
484
var metadata = metadataProvider.
GetMetadataForProperty
(
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (2)
420
var metadata = metadataProvider.
GetMetadataForProperty
(typeof(CollectionContainer), propertyName);
1129
return _metadataProvider.
GetMetadataForProperty
(type, propertyName);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (2)
500
var metadata = metadataProvider.
GetMetadataForProperty
(typeof(CollectionContainer), propertyName);
1293
return _metadataProvider.
GetMetadataForProperty
(type, propertyName);
ModelBinding\Binders\DictionaryModelBinderTest.cs (7)
143
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
214
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
301
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
338
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
398
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
571
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
672
var metadata = metadataProvider.
GetMetadataForProperty
(
ModelBinding\Binders\FormFileModelBinderTest.cs (1)
438
var metadata = metadataProvider.
GetMetadataForProperty
(
ModelBinding\Binders\HeaderModelBinderTests.cs (1)
402
return metadataProvider.
GetMetadataForProperty
(
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (1)
186
bindingContext.ModelMetadata = metadataProvider.
GetMetadataForProperty
(
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (1)
169
metadataProvider.
GetMetadataForProperty
(typeof(MetadataClass), nameof(MetadataClass.Property)),
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (1)
118
metadataProvider.
GetMetadataForProperty
(typeof(MetadataClass), nameof(MetadataClass.Property)),
ModelBinding\DefaultModelBindingContextTest.cs (2)
102
var propertyMetadata = metadataProvider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
131
var propertyMetadata = metadataProvider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
ModelBinding\Metadata\ModelMetadataProviderExtensionsTest.cs (1)
18
() => provider.
GetMetadataForProperty
(typeof(object), propertyName: "BadPropertyName"),
ModelBinding\ModelBinderFactoryTest.cs (1)
127
Metadata = metadataProvider.
GetMetadataForProperty
(typeof(Widget), nameof(Widget.Id)),
ModelBinding\ModelBindingHelperTest.cs (1)
1510
var modelMetadata = metadataProvider.
GetMetadataForProperty
(
ModelBinding\ParameterBinderTest.cs (3)
177
{ attribute, parameterDescriptor, provider1.
GetMetadataForProperty
(typeof(Family), nameof(Family.Mom)) },
441
var modelMetadata = modelMetadataProvider.
GetMetadataForProperty
(property.DeclaringType, property.Name);
495
var modelMetadata = modelMetadataProvider.
GetMetadataForProperty
(property.DeclaringType, property.Name);
ModelBinding\Validation\ClientValidatorCacheTest.cs (2)
16
var metadata = new TestModelMetadataProvider().
GetMetadataForProperty
(typeof(TypeWithProperty), "Property1");
43
var metadata = new TestModelMetadataProvider().
GetMetadataForProperty
(typeof(TypeWithProperty), "Property1");
ModelBinding\Validation\DefaultModelValidatorProviderTest.cs (4)
59
var metadata = metadataProvider.
GetMetadataForProperty
(
81
var metadata = metadataProvider.
GetMetadataForProperty
(
104
var metadata = metadataProvider.
GetMetadataForProperty
(
126
var metadata = metadataProvider.
GetMetadataForProperty
(
ModelBinding\Validation\ValidatorCacheTest.cs (2)
16
var metadata = new TestModelMetadataProvider().
GetMetadataForProperty
(typeof(TypeWithProperty), "Property1");
43
var metadata = new TestModelMetadataProvider().
GetMetadataForProperty
(typeof(TypeWithProperty), "Property1");
ValidationProblemDetailsTest.cs (1)
56
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
CompareAttributeAdapter.cs (1)
88
var otherProperty = validationContext.MetadataProvider.
GetMetadataForProperty
(
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (75)
CompareAttributeAdapterTest.cs (6)
21
var metadata = metadataProvider.
GetMetadataForProperty
(typeof(PropertyDisplayNameModel), "MyProperty");
56
var metadata = metadataProvider.
GetMetadataForProperty
(typeof(PropertyDisplayNameModel), "MyProperty");
99
var metadata = metadataProvider.
GetMetadataForProperty
(typeof(PropertyNameModel), "MyProperty");
133
var metadata = metadataProvider.
GetMetadataForProperty
(typeof(PropertyNameModel), "MyProperty");
172
var metadata = metadataProvider.
GetMetadataForProperty
(typeof(PropertyNameModel), "MyProperty");
211
var metadata = metadataProvider.
GetMetadataForProperty
(typeof(PropertyNameModel), "MyProperty");
DataAnnotationsClientModelValidatorProviderTest.cs (4)
24
var metadata = _metadataProvider.
GetMetadataForProperty
(
47
var metadata = _metadataProvider.
GetMetadataForProperty
(
78
var metadata = _metadataProvider.
GetMetadataForProperty
(
100
var metadata = _metadataProvider.
GetMetadataForProperty
(
DataAnnotationsModelValidatorProviderTest.cs (1)
44
var metadata = _metadataProvider.
GetMetadataForProperty
(
DataAnnotationsModelValidatorTest.cs (6)
49
_metadataProvider.
GetMetadataForProperty
(typeof(string), nameof(string.Length)),
56
_metadataProvider.
GetMetadataForProperty
(typeof(SampleModel), nameof(SampleModel.Name)),
156
var metadata = _metadataProvider.
GetMetadataForProperty
(typeof(string), "Length");
217
var metadata = _metadataProvider.
GetMetadataForProperty
(typeof(string), "Length");
242
var metadata = _metadataProvider.
GetMetadataForProperty
(typeof(string), "Length");
334
var metadata = _metadataProvider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
DefaultModelClientValidatorProviderTest.cs (6)
61
var metadata = metadataProvider.
GetMetadataForProperty
(
83
var metadata = metadataProvider.
GetMetadataForProperty
(
107
var metadata = metadataProvider.
GetMetadataForProperty
(
130
var metadata = metadataProvider.
GetMetadataForProperty
(
151
var metadata = metadataProvider.
GetMetadataForProperty
(
174
var metadata = metadataProvider.
GetMetadataForProperty
(
FileExtensionsAttributeAdapterTest.cs (4)
23
var metadata = provider.
GetMetadataForProperty
(typeof(Profile), nameof(Profile.PhotoFileName));
74
var metadata = provider.
GetMetadataForProperty
(typeof(Profile), nameof(Profile.PhotoFileName));
104
var metadata = provider.
GetMetadataForProperty
(typeof(Profile), nameof(Profile.PhotoFileName));
138
var metadata = provider.
GetMetadataForProperty
(typeof(Profile), "PhotoFileName");
MaxLengthAttributeAdapterTest.cs (5)
21
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
55
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
84
var metadata = provider.
GetMetadataForProperty
(typeof(string), propertyName);
111
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
144
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
MinLengthAttributeAdapterTest.cs (4)
21
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
55
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
83
var metadata = provider.
GetMetadataForProperty
(typeof(string), propertyName);
111
var metadata = provider.
GetMetadataForProperty
(typeof(string), propertyName);
ModelMetadataProviderTest.cs (21)
68
Assert.True(provider.
GetMetadataForProperty
(type, "NoAttribute").ShowForDisplay);
69
Assert.True(provider.
GetMetadataForProperty
(type, "ScaffoldColumnTrue").ShowForDisplay);
70
Assert.False(provider.
GetMetadataForProperty
(type, "ScaffoldColumnFalse").ShowForDisplay);
81
Assert.True(provider.
GetMetadataForProperty
(type, "NoAttribute").ShowForEdit);
82
Assert.True(provider.
GetMetadataForProperty
(type, "ScaffoldColumnTrue").ShowForEdit);
83
Assert.False(provider.
GetMetadataForProperty
(type, "ScaffoldColumnFalse").ShowForEdit);
153
var propertyMetadata = provider.
GetMetadataForProperty
(typeof(Person), nameof(Person.Parent));
166
var propertyMetadata = provider.
GetMetadataForProperty
(typeof(Person), nameof(Person.GrandParent));
348
var metadata = provider.
GetMetadataForProperty
(typeof(CoolUser), nameof(CoolUser.Name));
670
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
687
var metadata = provider.
GetMetadataForProperty
(typeof(Person), nameof(Person.Parent));
700
var metadata = provider.
GetMetadataForProperty
(
715
var metadata = metadataProvider.
GetMetadataForProperty
(
730
var metadata = metadataProvider.
GetMetadataForProperty
(
745
var metadata = metadataProvider.
GetMetadataForProperty
(
760
var metadata = metadataProvider.
GetMetadataForProperty
(
776
var metadata = metadataProvider.
GetMetadataForProperty
(
822
var metadata = metadataProvider.
GetMetadataForProperty
(type, propertyName);
838
var metadata = metadataProvider.
GetMetadataForProperty
(type, propertyName);
854
var metadata = metadataProvider.
GetMetadataForProperty
(type, propertyName);
870
var metadata = metadataProvider.
GetMetadataForProperty
(type, propertyName);
NumericClientModelValidatorTest.cs (3)
19
var metadata = provider.
GetMetadataForProperty
(typeof(TypeWithNumericProperty), "Id");
51
var metadata = provider.
GetMetadataForProperty
(
134
var metadata = provider.
GetMetadataForProperty
(typeof(TypeWithNumericProperty), "Id");
RangeAttributeAdapterTest.cs (3)
20
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
50
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
86
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
RequiredAttributeAdapterTest.cs (3)
21
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
56
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
81
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
StringLengthAttributeAdapterTest.cs (5)
21
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
56
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
83
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
111
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
137
var metadata = provider.
GetMetadataForProperty
(typeof(string), "Length");
ValidatableObjectAdapterTest.cs (3)
27
_metadataProvider.
GetMetadataForProperty
(
35
_metadataProvider.
GetMetadataForProperty
(
153
var metadata = _metadataProvider.
GetMetadataForProperty
(
ValidationAttributeAdapterOfTAttributeTest.cs (1)
20
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(string), "Length");
Microsoft.AspNetCore.Mvc.IntegrationTests (4)
BindPropertyIntegrationTest.cs (4)
122
.
GetMetadataForProperty
(typeof(TestController), parameter.Name);
162
.
GetMetadataForProperty
(typeof(TestController), parameter.Name);
220
.
GetMetadataForProperty
(typeof(TestPage), propertyDescriptor.Name);
281
.
GetMetadataForProperty
(typeof(TestController), parameter.Name);
Microsoft.AspNetCore.Mvc.RazorPages (2)
ApplicationModels\DefaultPageApplicationModelPartsProvider.cs (1)
112
var propertyMetadata = _modelMetadataProvider.
GetMetadataForProperty
(property.DeclaringType!, property.Name);
Infrastructure\PageBinderFactory.cs (1)
33
var metadata = modelMetadataProvider.
GetMetadataForProperty
(handlerType, property.Name);
Microsoft.AspNetCore.Mvc.TagHelpers.Test (6)
InputTagHelperTest.cs (1)
2403
var propertyMetadata = metadataProvider.
GetMetadataForProperty
(containerType, propertyName);
LabelTagHelperTest.cs (1)
171
var propertyMetadata = metadataProvider.
GetMetadataForProperty
(containerType, "Text");
SelectTagHelperTest.cs (3)
193
var propertyMetadata = metadataProvider.
GetMetadataForProperty
(containerType, "Text");
283
var propertyMetadata = metadataProvider.
GetMetadataForProperty
(containerType, "Text");
463
var propertyMetadata = metadataProvider.
GetMetadataForProperty
(containerType, "Text");
TextAreaTagHelperTest.cs (1)
102
var propertyMetadata = metadataProvider.
GetMetadataForProperty
(containerType, "Text");
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (20)
DefaultHtmlGeneratorTest.cs (9)
199
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(ModelWithMaxLengthMetadata), expression);
223
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(ModelWithMaxLengthMetadata), expression);
247
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(ModelWithMaxLengthMetadata), expression);
269
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(ModelWithMaxLengthMetadata), nameof(ModelWithMaxLengthMetadata.FieldWithBothAttributes));
291
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(ModelWithMaxLengthMetadata), nameof(ModelWithMaxLengthMetadata.FieldWithoutAttributes));
314
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(ModelWithMaxLengthMetadata), expression);
367
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(Model), expression);
397
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(Model), expression);
422
var modelMetadata = metadataProvider.
GetMetadataForProperty
(typeof(ModelWithMaxLengthMetadata), expression);
ModelStateDictionaryExtensionsTest.cs (4)
102
var metadata = provider.
GetMetadataForProperty
(typeof(TestModel), nameof(TestModel.Text));
140
var metadata = provider.
GetMetadataForProperty
(typeof(ChildModel), nameof(ChildModel.Text));
178
var metadata = provider.
GetMetadataForProperty
(typeof(ChildModel), nameof(ChildModel.Value));
218
var metadata = provider.
GetMetadataForProperty
(typeof(string), nameof(string.Length));
PageRemoteAttributeTest.cs (1)
172
var metadata = metadataProvider.
GetMetadataForProperty
(
RemoteAttributeBaseTest.cs (1)
494
var metadata = metadataProvider.
GetMetadataForProperty
(
RemoteAttributeTest.cs (2)
375
var metadata = metadataProvider.
GetMetadataForProperty
(
422
var metadata = metadataProvider.
GetMetadataForProperty
(
Rendering\HtmlHelperValidationSummaryTest.cs (3)
671
var metadata = provider.
GetMetadataForProperty
(typeof(ValidationModel), nameof(ValidationModel.Property3));
675
metadata = provider.
GetMetadataForProperty
(typeof(ValidationModel), nameof(ValidationModel.Property2));
690
var metadata = provider.
GetMetadataForProperty
(typeof(OrderedModel), nameof(OrderedModel.Property3));