5 instantiations of ModelAttributes
Microsoft.AspNetCore.Mvc.Core (5)
ModelBinding\Metadata\ModelAttributes.cs (5)
16internal static readonly ModelAttributes Empty = new ModelAttributes(Array.Empty<object>()); 147return new ModelAttributes(typeAttributes, propertyAttributes, parameterAttributes: null); 168return new ModelAttributes(attributes, propertyAttributes: null, parameterAttributes: null); 188return new ModelAttributes(typeAttributes, propertyAttributes: null, parameterAttributes); 212return new ModelAttributes(typeAttributes, propertyAttributes: null, parameterAttributes);
88 references to ModelAttributes
Microsoft.AspNetCore.Mvc.Core (24)
ModelBinding\Metadata\BindingMetadataProviderContext.cs (1)
20ModelAttributes attributes)
ModelBinding\Metadata\DefaultMetadataDetails.cs (2)
21public DefaultMetadataDetails(ModelMetadataIdentity key, ModelAttributes attributes) 32public ModelAttributes ModelAttributes { get; }
ModelBinding\Metadata\DefaultModelMetadata.cs (1)
79public ModelAttributes Attributes => _details.ModelAttributes;
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (5)
247var constructorDetails = new DefaultMetadataDetails(constructorKey, ModelAttributes.Empty); 361var attributes = ModelAttributes.GetAttributesForProperty( 399ModelAttributes.GetAttributesForType(key.ModelType)); 413ModelAttributes.GetAttributesForParameter(key.ParameterInfo!, key.ModelType));
ModelBinding\Metadata\DisplayMetadataProviderContext.cs (1)
20ModelAttributes attributes)
ModelBinding\Metadata\ModelAttributes.cs (13)
16internal static readonly ModelAttributes Empty = new ModelAttributes(Array.Empty<object>()); 19/// Creates a new <see cref="ModelAttributes"/>. 27/// Creates a new <see cref="ModelAttributes"/>. 111/// A <see cref="ModelAttributes"/> instance with the attributes of the property and its <see cref="Type"/>. 113public static ModelAttributes GetAttributesForProperty(Type type, PropertyInfo property) 127/// A <see cref="ModelAttributes"/> instance with the attributes of the property and its <see cref="Type"/>. 129public static ModelAttributes GetAttributesForProperty(Type containerType, PropertyInfo property, Type modelType) 155/// <returns>A <see cref="ModelAttributes"/> instance with the attributes of the <see cref="Type"/>.</returns> 156public static ModelAttributes GetAttributesForType(Type type) 178/// A <see cref="ModelAttributes"/> instance with the attributes of the parameter and its <see cref="Type"/>. 180public static ModelAttributes GetAttributesForParameter(ParameterInfo parameterInfo) 199/// A <see cref="ModelAttributes"/> instance with the attributes of the parameter and its <see cref="Type"/>. 201public static ModelAttributes GetAttributesForParameter(ParameterInfo parameterInfo, Type modelType)
ModelBinding\Metadata\ValidationMetadataProviderContext.cs (1)
20ModelAttributes attributes)
Microsoft.AspNetCore.Mvc.Core.Test (41)
ModelBinding\Metadata\DefaultModelMetadataTest.cs (3)
126var attributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), null); 163var attributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), null); 200var attributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), null);
ModelBinding\Metadata\HasValidatorsValidationMetadataProviderTest.cs (5)
23var modelAttributes = new ModelAttributes(new object[0], new object[0], new object[0]); 41var modelAttributes = new ModelAttributes(new object[0], new object[0], new object[0]); 69var modelAttributes = new ModelAttributes(new object[0], new object[0], new object[0]); 93var modelAttributes = new ModelAttributes(new object[0], new object[0], new object[0]); 116var modelAttributes = new ModelAttributes(new object[0], new object[0], new object[0]);
ModelBinding\Metadata\ModelAttributesTest.cs (29)
19var attributes = ModelAttributes.GetAttributesForProperty(modelType, property); 37var attributes = ModelAttributes.GetAttributesForProperty(modelType, property); 67var attributes = ModelAttributes.GetAttributesForProperty(modelType, property); 85var attributes = ModelAttributes.GetAttributesForProperty(modelType, property); 105var attributes = ModelAttributes.GetAttributesForProperty(modelType, property); 123var attributes = ModelAttributes.GetAttributesForProperty(modelType, property); 137var attributes = ModelAttributes.GetAttributesForType(typeof(BaseViewModel)); 149var attributes = ModelAttributes.GetAttributesForType(typeof(BaseViewModel)); 162var attributes = ModelAttributes.GetAttributesForProperty(typeof(MergedAttributes), property); 182var attributes = ModelAttributes.GetAttributesForParameter( 199var attributes = ModelAttributes.GetAttributesForParameter( 230var attributes = ModelAttributes.GetAttributesForParameter(parameters[2]); 250var attributes = ModelAttributes.GetAttributesForParameter(parameters[2], typeof(DerivedModelWithAttributes)); 274var attributes = ModelAttributes.GetAttributesForProperty(typeof(MergedAttributes), property, typeof(DerivedModelWithAttributes)); 298var exception = Assert.Throws<InvalidOperationException>(() => ModelAttributes.GetAttributesForProperty(modelType, property));
ModelBinding\Metadata\SystemTextJsonValidationMetadataProviderTest.cs (4)
18var modelAttributes = new ModelAttributes(Array.Empty<object>(), new[] { new JsonPropertyNameAttribute(propertyName) }, Array.Empty<object>()); 36var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>()); 53var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>()); 71var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>());
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (20)
DataAnnotationsMetadataProviderTest.cs (19)
1150var attributes = ModelAttributes.GetAttributesForProperty( 1174var attributes = ModelAttributes.GetAttributesForProperty( 1203var attributes = ModelAttributes.GetAttributesForProperty( 1233var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1252var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1271var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1292var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1312var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1331var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1350var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1369var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1390var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForParameter(parameter)); 1411var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForParameter(parameter)); 1432var context = new ValidationMetadataProviderContext(key, ModelAttributes.GetAttributesForProperty(modelType, property)); 1727private ModelAttributes GetModelAttributes(IEnumerable<object> typeAttributes) 1730private ModelAttributes GetModelAttributes(
DataMemberRequiredBindingMetadataProviderTest.cs (1)
140private ModelAttributes GetModelAttributes(
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (3)
NewtonsoftJsonValidationMetadataProviderTest.cs (3)
20var modelAttributes = new ModelAttributes(Array.Empty<object>(), new[] { new JsonPropertyAttribute() { PropertyName = propertyName } }, Array.Empty<object>()); 38var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>()); 57var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>());