1 write to PropertyAttributes
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Metadata\ModelAttributes.cs (1)
52PropertyAttributes = propertyAttributes.ToArray();
31 references to PropertyAttributes
Microsoft.AspNetCore.Mvc.Core (4)
ModelBinding\Metadata\BindingMetadataProviderContext.cs (1)
27PropertyAttributes = attributes.PropertyAttributes;
ModelBinding\Metadata\DisplayMetadataProviderContext.cs (1)
26PropertyAttributes = attributes.PropertyAttributes;
ModelBinding\Metadata\ModelAttributes.cs (1)
54Attributes = PropertyAttributes.Concat(TypeAttributes).ToArray();
ModelBinding\Metadata\ValidationMetadataProviderContext.cs (1)
27PropertyAttributes = attributes.PropertyAttributes;
Microsoft.AspNetCore.Mvc.Core.Test (22)
ModelBinding\Metadata\ModelAttributesTest.cs (22)
25Assert.Single(attributes.PropertyAttributes.OfType<RequiredAttribute>()); 26Assert.Single(attributes.PropertyAttributes.OfType<StringLengthAttribute>()); 49rangeAttributes = attributes.PropertyAttributes.OfType<RangeAttribute>().ToArray(); 56Assert.Single(attributes.PropertyAttributes.OfType<FromHeaderAttribute>()); 73Assert.Single(attributes.PropertyAttributes.OfType<RequiredAttribute>()); 74Assert.Single(attributes.PropertyAttributes.OfType<StringLengthAttribute>()); 92Assert.Single(attributes.PropertyAttributes.OfType<RequiredAttribute>()); 93Assert.Single(attributes.PropertyAttributes.OfType<StringLengthAttribute>()); 94Assert.DoesNotContain(typeof(RangeAttribute), attributes.PropertyAttributes); 111Assert.Single(attributes.PropertyAttributes.OfType<RequiredAttribute>()); 112Assert.Single(attributes.PropertyAttributes.OfType<RangeAttribute>()); 129Assert.Single(attributes.PropertyAttributes.OfType<RequiredAttribute>()); 130Assert.Single(attributes.PropertyAttributes.OfType<FromRouteAttribute>()); 152Assert.Null(attributes.PropertyAttributes); 170Assert.Equal(2, attributes.PropertyAttributes.Count); 171Assert.IsType<RequiredAttribute>(attributes.PropertyAttributes[0]); 172Assert.IsType<RangeAttribute>(attributes.PropertyAttributes[1]); 190Assert.Null(attributes.PropertyAttributes); 218Assert.Null(attributes.PropertyAttributes); 239Assert.Null(attributes.PropertyAttributes); 261Assert.Null(attributes.PropertyAttributes); 284Assert.IsType<BindRequiredAttribute>(Assert.Single(attributes.PropertyAttributes));
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (1)
ModelMetadataProviderTest.cs (1)
1084_attributes.Concat(e.ModelAttributes.PropertyAttributes),
Microsoft.AspNetCore.OpenApi (4)
Extensions\JsonNodeSchemaExtensions.cs (2)
332if (parameterDescription.ModelMetadata is Mvc.ModelBinding.Metadata.DefaultModelMetadata { Attributes.PropertyAttributes.Count: > 0 } metadata && 333metadata.Attributes.PropertyAttributes.OfType<DefaultValueAttribute>().LastOrDefault() is { } metadataDefaultValueAttribute)
Services\OpenApiDocumentService.cs (2)
517if (parameter.ModelMetadata is Mvc.ModelBinding.Metadata.DefaultModelMetadata { Attributes.PropertyAttributes.Count: > 0 } metadata && 518metadata.Attributes.PropertyAttributes.OfType<DescriptionAttribute>().LastOrDefault() is { } propertyDescription)