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