5 writes to Attributes
Microsoft.AspNetCore.Mvc.Core (5)
ModelBinding\Metadata\ModelAttributes.cs (5)
23
Attributes
= attributes;
54
Attributes
= PropertyAttributes.Concat(TypeAttributes).ToArray();
63
Attributes
= ParameterAttributes.Concat(TypeAttributes).ToArray();
67
Attributes
= TypeAttributes = typeAttributes.ToArray();
71
Attributes
= Array.Empty<object>();
38 references to Attributes
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
DefaultApiDescriptionProvider.cs (1)
271
!defaultModelMetadata.Attributes.
Attributes
.OfType<IFromRouteMetadata>().Any())
Microsoft.AspNetCore.Mvc.Core (3)
ModelBinding\Metadata\BindingMetadataProviderContext.cs (1)
25
Attributes = attributes.
Attributes
;
ModelBinding\Metadata\DisplayMetadataProviderContext.cs (1)
25
Attributes = attributes.
Attributes
;
ModelBinding\Metadata\ValidationMetadataProviderContext.cs (1)
25
Attributes = attributes.
Attributes
;
Microsoft.AspNetCore.Mvc.Core.Test (34)
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (10)
23
var attribute = Assert.IsType<ModelAttribute>(Assert.Single(defaultMetadata.Attributes.
Attributes
));
163
var attributes = defaultMetadata.Attributes.
Attributes
.ToArray();
215
Assert.IsType<SerializableAttribute>(Assert.Single(defaultMetadata.Attributes.
Attributes
));
234
defaultMetadata.Attributes.
Attributes
.Take(2),
283
defaultModelMetadata.Attributes.
Attributes
,
296
defaultPropertyMetadata.Attributes.
Attributes
.OfType<ModelAttribute>(),
305
defaultPropertyMetadata.Attributes.
Attributes
.OfType<ModelAttribute>(),
367
defaultModelMetadata.Attributes.
Attributes
,
380
defaultPropertyMetadata.Attributes.
Attributes
.OfType<ModelAttribute>(),
389
defaultPropertyMetadata.Attributes.
Attributes
.OfType<ModelAttribute>(),
ModelBinding\Metadata\ModelAttributesTest.cs (24)
22
Assert.Single(attributes.
Attributes
.OfType<RequiredAttribute>());
23
Assert.Single(attributes.
Attributes
.OfType<StringLengthAttribute>());
40
var rangeAttributes = attributes.
Attributes
.OfType<RangeAttribute>().ToArray();
47
Assert.Single(attributes.
Attributes
.OfType<FromHeaderAttribute>());
70
Assert.Single(attributes.
Attributes
.OfType<RequiredAttribute>());
71
Assert.Single(attributes.
Attributes
.OfType<StringLengthAttribute>());
88
Assert.Single(attributes.
Attributes
.OfType<RequiredAttribute>());
89
Assert.Single(attributes.
Attributes
.OfType<StringLengthAttribute>());
90
Assert.DoesNotContain(typeof(RangeAttribute), attributes.
Attributes
);
108
Assert.Single(attributes.
Attributes
.OfType<RequiredAttribute>());
109
Assert.Single(attributes.
Attributes
.OfType<RangeAttribute>());
126
Assert.Single(attributes.
Attributes
.OfType<RequiredAttribute>());
127
Assert.Single(attributes.
Attributes
.OfType<FromRouteAttribute>());
140
Assert.Single(attributes.
Attributes
.OfType<ClassValidator>());
165
Assert.Equal(3, attributes.
Attributes
.Count);
166
Assert.IsType<RequiredAttribute>(attributes.
Attributes
[0]);
167
Assert.IsType<RangeAttribute>(attributes.
Attributes
[1]);
168
Assert.IsType<ClassValidator>(attributes.
Attributes
[2]);
189
Assert.IsType<SerializableAttribute>(Assert.Single(attributes.
Attributes
));
192
Assert.Equal(attributes.
Attributes
, attributes.TypeAttributes);
207
attributes.
Attributes
.Take(2),
233
Assert.Collection(attributes.
Attributes
,
254
attributes.
Attributes
,
278
attributes.
Attributes
,