94 references to
Microsoft.AspNetCore.Mvc.Core (3)
ModelBinding\Binders\DictionaryModelBinder.cs (1)
159var valueMetadata = elementMetadata.Properties[nameof(KeyValuePair<TKey, TValue>.Value)]!;
ModelBinding\Binders\KeyValuePairModelBinder.cs (1)
96var propertyModelMetadata = bindingContext.ModelMetadata.Properties[propertyName]!;
ModelBinding\ModelMetadataProviderExtensions.cs (1)
34var propertyMetadata = containerMetadata.Properties[propertyName];
Microsoft.AspNetCore.Mvc.Core.Test (79)
ControllerBaseTest.cs (31)
2621Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property1"])); 2622Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property2"])); 2649Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property1"])); 2650Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property2"])); 2676Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property1"])); 2677Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property2"])); 2730Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Include1"])); 2731Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Include2"])); 2733Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude1"])); 2734Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude2"])); 2763Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Include1"])); 2764Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Include2"])); 2766Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude1"])); 2767Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude2"])); 2797Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property1"])); 2798Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property2"])); 2800Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude1"])); 2801Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude2"])); 2829Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property1"])); 2830Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property2"])); 2832Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude1"])); 2833Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude2"])); 2865var modelMetadata = context.ModelMetadata.Properties[propertyName]; 2913Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Include1"])); 2914Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Include2"])); 2916Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude1"])); 2917Assert.False(context.PropertyFilter(context.ModelMetadata.Properties["Exclude2"])); 2945Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property1"])); 2946Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property2"])); 2973Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property1"])); 2974Assert.True(context.PropertyFilter(context.ModelMetadata.Properties["Property2"]));
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (10)
844var firstNameProperty = containerMetadata.Properties[nameof(model.FirstName)]; 847var lastNameProperty = containerMetadata.Properties[nameof(model.LastName)]; 869var propertyMetadata = metadata.Properties[nameof(model.PropertyWithDefaultValue)]; 891var propertyMetadata = metadata.Properties[nameof(model.PropertyWithInitializedValue)]; 915var propertyMetadata = metadata.Properties[nameof(model.PropertyWithInitializedValueAndDefault)]; 939var propertyMetadata = metadata.Properties[nameof(model.NonUpdateableProperty)]; 981var propertyMetadata = bindingContext.ModelMetadata.Properties[propertyName]; 1024var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.DateOfBirth)]; 1048var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.DateOfDeath)]; 1069var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.NameNoAttribute)];
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (10)
981var firstNameProperty = containerMetadata.Properties[nameof(model.FirstName)]; 984var lastNameProperty = containerMetadata.Properties[nameof(model.LastName)]; 1031var propertyMetadata = metadata.Properties[nameof(model.PropertyWithDefaultValue)]; 1053var propertyMetadata = metadata.Properties[nameof(model.PropertyWithInitializedValue)]; 1077var propertyMetadata = metadata.Properties[nameof(model.PropertyWithInitializedValueAndDefault)]; 1101var propertyMetadata = metadata.Properties[nameof(model.NonUpdateableProperty)]; 1143var propertyMetadata = bindingContext.ModelMetadata.Properties[propertyName]; 1186var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.DateOfBirth)]; 1210var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.DateOfDeath)]; 1231var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.NameNoAttribute)];
ModelBinding\Binders\DictionaryModelBinderTest.cs (2)
348{ valueMetadata.Properties["Id"], new SimpleTypeModelBinder(typeof(int), NullLoggerFactory.Instance) }, 349{ valueMetadata.Properties["Name"], new SimpleTypeModelBinder(typeof(string), NullLoggerFactory.Instance) },
ModelBinding\Metadata\DefaultModelMetadataTest.cs (3)
763var isReadOnly = metadata.Properties["PublicGetPrivateSetProperty"].IsReadOnly; 782var isReadOnly = metadata.Properties["PublicGetProtectedSetProperty"].IsReadOnly; 801var isReadOnly = metadata.Properties["PublicGetPublicSetProperty"].IsReadOnly;
ModelBinding\ModelBinderFactoryTest.cs (9)
74Assert.NotNull(c.CreateBinder(c.Metadata.Properties[nameof(Widget.Id)])); 149Assert.NotNull(c.CreateBinder(c.Metadata.Properties[nameof(Widget.Id)])); 190var binder = c.CreateBinder(c.Metadata.Properties[nameof(Employee.Manager)]); 403var binder = c.CreateBinder(c.Metadata.Properties[nameof(Widget.Id)]); 464var binder = c.CreateBinder(c.Metadata.Properties[nameof(Widget.Id)]); 528inner = c.CreateBinder(c.Metadata.Properties[nameof(Widget.Id)]); 558context.Metadata = context.Metadata.Properties[nameof(Widget.Id)]; 591inner = c.CreateBinder(c.Metadata.Properties[nameof(Widget.Id)]); 622context.Metadata = context.Metadata.Properties[nameof(Widget.Id)];
ModelBinding\Validation\ClientValidatorCacheTest.cs (2)
72var property = metadata.Properties[nameof(TestRecordType.Property1)]; 93var property = metadata.Properties[nameof(TestRecordTypeWithProperty.Property2)];
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (12)
36Assert.Same(metadata.Properties["Age"], entry.Metadata); 42Assert.Same(metadata.Properties["Id"], entry.Metadata); 48Assert.Same(metadata.Properties["Name"], entry.Metadata); 76Assert.Same(metadata.Properties["Age"], entry.Metadata); 82Assert.Same(metadata.Properties["Id"], entry.Metadata); 88Assert.Same(metadata.Properties["Name"], entry.Metadata); 110Assert.Same(metadata.Properties["Age"], entry.Metadata); 116Assert.Same(metadata.Properties["Id"], entry.Metadata); 122Assert.Same(metadata.Properties["Name"], entry.Metadata); 145Assert.Same(metadata.Properties["Age"], entry.Metadata); 151Assert.Same(metadata.Properties["Id"], entry.Metadata); 157Assert.Same(metadata.Properties["Name"], entry.Metadata);
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (5)
ModelMetadataProviderTest.cs (5)
92var property = metadata.Properties["DirectlyHidden"]; 107var property = metadata.Properties["OfHiddenType"]; 122var property = metadata.Properties["DirectlyHidden"]; 137var property = metadata.Properties["OfHiddenType"]; 795Assert.Null(metadata.Properties[propertyName]);
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
ValidationIntegrationTests.cs (1)
1547var otherProperty = parentEntry.Metadata.Properties[_otherProperty];
ValidationWithRecordIntegrationTests.cs (1)
1357var otherProperty = parentEntry.Metadata.Properties[_otherProperty];
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
NewtonsoftJsonInputFormatter.cs (1)
400var propertyMetadata = metadata.Properties[propertyName];
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
ExpressionMetadataProvider.cs (2)
102metadata = metadataProvider.GetMetadataForType(containerType).Properties[propertyName]; 177var propertyMetadata = containerMetadata.Properties[viewDataInfo.PropertyInfo.Name];
ModelExplorer.cs (2)
266var propertyMetadata = metadata.Properties[name]; 291var propertyMetadata = metadata.Properties[name];