1 write to Attribute
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
ValidationAttributeAdapterOfTAttribute.cs (1)
26Attribute = attribute;
36 references to Attribute
Microsoft.AspNetCore.Mvc.Core.Test (8)
ModelBinding\Validation\ClientValidatorCacheTest.cs (8)
23var attribute1 = Assert.Single(validators1.OfType<RequiredAttributeAdapter>()).Attribute; 24var attribute2 = Assert.Single(validators1.OfType<StringLengthAttributeAdapter>()).Attribute; 52Assert.Contains(validator1.Attribute, metadata.ValidatorMetadata); // Copied by provider 53Assert.Contains(validator2.Attribute, metadata.ValidatorMetadata); // Copied by provider 82Assert.Contains(validator1.Attribute, parameter.ValidatorMetadata); // Copied by provider 83Assert.Contains(validator2.Attribute, parameter.ValidatorMetadata); // Copied by provider 102Assert.Contains(validator1.Attribute, property.ValidatorMetadata); // Copied by provider 103Assert.Contains(validator2.Attribute, property.ValidatorMetadata); // Copied by provider
Microsoft.AspNetCore.Mvc.DataAnnotations (27)
CompareAttributeAdapter.cs (2)
39Attribute); 41((CompareAttributeWrapper)Attribute).ValidationContext = validationContext;
DataTypeAttributeAdapter.cs (1)
42Attribute.GetDataTypeName());
FileExtensionsAttributeAdapter.cs (1)
23var normalizedExtensions = Attribute.Extensions.Replace(" ", string.Empty).Replace(".", string.Empty).ToLowerInvariant();
MaxLengthAttributeAdapter.cs (2)
18_max = Attribute.Length.ToString(CultureInfo.InvariantCulture); 38Attribute.Length);
MinLengthAttributeAdapter.cs (2)
18_min = Attribute.Length.ToString(CultureInfo.InvariantCulture); 38Attribute.Length);
RangeAttributeAdapter.cs (4)
26_max = Convert.ToString(Attribute.Maximum, CultureInfo.InvariantCulture)!; 27_min = Convert.ToString(Attribute.Minimum, CultureInfo.InvariantCulture)!; 48Attribute.Minimum, 49Attribute.Maximum);
RegularExpressionAttributeAdapter.cs (2)
23MergeAttribute(context.Attributes, "data-val-regex-pattern", Attribute.Pattern); 34Attribute.Pattern);
StringLengthAttributeAdapter.cs (6)
19_max = Attribute.MaximumLength.ToString(CultureInfo.InvariantCulture); 20_min = Attribute.MinimumLength.ToString(CultureInfo.InvariantCulture); 31if (Attribute.MaximumLength != int.MaxValue) 36if (Attribute.MinimumLength != 0) 50Attribute.MaximumLength, 51Attribute.MinimumLength);
ValidationAttributeAdapterOfTAttribute.cs (7)
59/// Gets the error message formatted using the <see cref="Attribute"/>. 62/// <see cref="Attribute"/>.</param> 70!string.IsNullOrEmpty(Attribute.ErrorMessage) && 71string.IsNullOrEmpty(Attribute.ErrorMessageResourceName) && 72Attribute.ErrorMessageResourceType == null) 74return _stringLocalizer[Attribute.ErrorMessage, arguments]; 77return Attribute.FormatErrorMessage(modelMetadata.GetDisplayName());
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (1)
DataAnnotationsClientModelValidatorProviderTest.cs (1)
112Assert.Equal("Custom Required Message", adapter.Attribute.ErrorMessage);