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