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