1 write to Attribute
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
DataAnnotationsModelValidator.cs (1)
36Attribute = attribute;
17 references to Attribute
Microsoft.AspNetCore.Mvc.Core.Test (9)
ModelBinding\Validation\DefaultModelValidatorProviderTest.cs (3)
116Assert.IsType<RangeAttribute>(adapter.Attribute); 138Assert.Single(validatorItems, v => ((DataAnnotationsModelValidator)v.Validator).Attribute is RegularExpressionAttribute); 139Assert.Single(validatorItems, v => ((DataAnnotationsModelValidator)v.Validator).Attribute is StringLengthAttribute);
ModelBinding\Validation\ValidatorCacheTest.cs (6)
23var attribute1 = Assert.IsType<DataAnnotationsModelValidator>(validators1[0]).Attribute; 24var attribute2 = Assert.IsType<DataAnnotationsModelValidator>(validators1[1]).Attribute; 52Assert.Contains(validator1.Attribute, metadata.ValidatorMetadata); // Copied by provider 53Assert.Contains(validator2.Attribute, metadata.ValidatorMetadata); // Copied by provider 61var requiredValidator = Assert.Single(validators2.Where(v => (v as DataAnnotationsModelValidator).Attribute is RequiredAttribute)); 63var stringLengthValidator = Assert.Single(validators2.Where(v => (v as DataAnnotationsModelValidator).Attribute is StringLengthAttribute));
Microsoft.AspNetCore.Mvc.DataAnnotations (5)
DataAnnotationsModelValidator.cs (5)
83var result = Attribute.GetValidationResult(validationContext.Model, context); 88!string.IsNullOrEmpty(Attribute.ErrorMessage) && 89string.IsNullOrEmpty(Attribute.ErrorMessageResourceName) && 90Attribute.ErrorMessageResourceType == null) 134var adapter = _validationAttributeAdapterProvider.GetAttributeAdapter(Attribute, _stringLocalizer);
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (3)
DataAnnotationsModelValidatorProviderTest.cs (2)
55Assert.IsAssignableFrom<RequiredAttribute>(((DataAnnotationsModelValidator)providerContext.Results[0].Validator).Attribute); 56Assert.IsAssignableFrom<RequiredAttribute>(((DataAnnotationsModelValidator)providerContext.Results[1].Validator).Attribute);
DataAnnotationsModelValidatorTest.cs (1)
32Assert.Same(attribute, validator.Attribute);