29 types derived from ValidationAttribute
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
RemoteAttributeBase.cs (1)
26
public abstract class RemoteAttributeBase :
ValidationAttribute
, IClientModelValidator
Microsoft.Extensions.Compliance.Redaction (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29
internal sealed class LengthAttribute :
ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23
internal sealed class TimeSpanAttribute :
ValidationAttribute
Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29
internal sealed class LengthAttribute :
ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23
internal sealed class TimeSpanAttribute :
ValidationAttribute
Microsoft.Extensions.Diagnostics.Probes (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29
internal sealed class LengthAttribute :
ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23
internal sealed class TimeSpanAttribute :
ValidationAttribute
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29
internal sealed class LengthAttribute :
ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23
internal sealed class TimeSpanAttribute :
ValidationAttribute
Microsoft.Extensions.Http.Resilience (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29
internal sealed class LengthAttribute :
ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23
internal sealed class TimeSpanAttribute :
ValidationAttribute
Microsoft.Extensions.Telemetry (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29
internal sealed class LengthAttribute :
ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23
internal sealed class TimeSpanAttribute :
ValidationAttribute
Shared (2)
Data.Validation\LengthAttribute.cs (1)
29
internal sealed class LengthAttribute :
ValidationAttribute
Data.Validation\TimeSpanAttribute.cs (1)
23
internal sealed class TimeSpanAttribute :
ValidationAttribute
System.ComponentModel.Annotations (14)
System\ComponentModel\DataAnnotations\AllowedValuesAttribute.cs (1)
12
public class AllowedValuesAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\AsyncValidationAttribute.cs (1)
13
public abstract class AsyncValidationAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\Base64StringAttribute.cs (1)
16
public class Base64StringAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\CompareAttribute.cs (1)
12
public class CompareAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
58
public sealed class CustomValidationAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\DataTypeAttribute.cs (1)
16
public class DataTypeAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\DeniedValuesAttribute.cs (1)
12
public class DeniedValuesAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\LengthAttribute.cs (1)
13
public class LengthAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
17
public class MaxLengthAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\MinLengthAttribute.cs (1)
14
public class MinLengthAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\RangeAttribute.cs (1)
14
public class RangeAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (1)
15
public class RegularExpressionAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\RequiredAttribute.cs (1)
11
public class RequiredAttribute :
ValidationAttribute
System\ComponentModel\DataAnnotations\StringLengthAttribute.cs (1)
14
public class StringLengthAttribute :
ValidationAttribute
124 references to ValidationAttribute
Microsoft.AspNetCore.Components.Endpoints (8)
Forms\ClientValidationCache.cs (1)
224
var validationAttributes = property.GetCustomAttributes<
ValidationAttribute
>(inherit: true).ToArray();
Forms\ClientValidationFieldMetadata.cs (2)
13
ValidationAttribute
[] validationAttributes,
20
public
ValidationAttribute
[] ValidationAttributes { get; } = validationAttributes;
Forms\DataAnnotationsClientValidationProvider.cs (2)
88
foreach (
var
attribute in fieldMetadata.ValidationAttributes)
119
private static bool TryWriteBuiltInRule(ClientValidationDataWriter writer,
ValidationAttribute
validationAttribute, string errorMessage)
Forms\DataAnnotationsLocalizer.cs (2)
48
ValidationAttribute
attribute,
84
ValidationAttribute
attribute,
Forms\IClientValidationRuleProvider.cs (1)
7
/// Implemented by <see cref="System.ComponentModel.DataAnnotations.
ValidationAttribute
"/> subclasses
Microsoft.AspNetCore.Mvc.DataAnnotations (25)
AttributeAdapterBase.cs (3)
14
/// <typeparam name="TAttribute">The type of <see cref="
ValidationAttribute
"/> which is being wrapped.</typeparam>
18
where TAttribute :
ValidationAttribute
23
/// <param name="attribute">The <see cref="
ValidationAttribute
"/> being wrapped.</param>
DataAnnotationsClientModelValidatorProvider.cs (3)
13
/// for attributes which derive from <see cref="
ValidationAttribute
"/>. It also provides
73
var
attribute = validatorItem.ValidatorMetadata as
ValidationAttribute
;
DataAnnotationsMetadataProvider.cs (2)
378
foreach (
var
attribute in attributes.OfType<
ValidationAttribute
>())
DataAnnotationsModelValidator.cs (5)
12
/// Validates based on the given <see cref="
ValidationAttribute
"/>.
23
/// <param name="attribute">The <see cref="
ValidationAttribute
"/> that defines what we're validating.</param>
29
ValidationAttribute
attribute,
43
public
ValidationAttribute
Attribute { get; }
46
/// Validates the context against the <see cref="
ValidationAttribute
"/>.
DataAnnotationsModelValidatorProvider.cs (3)
13
/// for attributes which derive from <see cref="
ValidationAttribute
"/>. It also provides
65
if (!(validatorItem.ValidatorMetadata is
ValidationAttribute
attribute))
108
if (validatorMetadata[i] is
ValidationAttribute
)
IValidationAttributeAdapterProvider.cs (3)
15
/// Returns the <see cref="IAttributeAdapter"/> for the given <see cref="
ValidationAttribute
"/>.
17
/// <param name="attribute">The <see cref="
ValidationAttribute
"/> to create an <see cref="IAttributeAdapter"/>
22
IAttributeAdapter? GetAttributeAdapter(
ValidationAttribute
attribute, IStringLocalizer? stringLocalizer);
ValidationAttributeAdapterOfTAttribute.cs (1)
16
where TAttribute :
ValidationAttribute
ValidationAttributeAdapterProvider.cs (1)
20
public IAttributeAdapter? GetAttributeAdapter(
ValidationAttribute
attribute, IStringLocalizer? stringLocalizer)
ValidationProviderAttribute.cs (4)
9
/// Abstract class for grouping attributes of type <see cref="
ValidationAttribute
"/> into
15
/// Gets <see cref="
ValidationAttribute
" /> instances associated with this attribute.
17
/// <returns>Sequence of <see cref="
ValidationAttribute
" /> associated with this attribute.</returns>
18
public abstract IEnumerable<
ValidationAttribute
> GetValidationAttributes();
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
RemoteAttributeBase.cs (3)
21
/// A <see cref="
ValidationAttribute
"/> which configures Unobtrusive validation to send an Ajax request to the
124
/// Always returns <c>true</c> since this <see cref="
ValidationAttribute
"/> does no validation itself.
139
/// Calls derived <see cref="
ValidationAttribute
"/> implementation of <see cref="GetUrl(ClientModelValidationContext)"/>.
Microsoft.AspNetCore.OpenApi (3)
Extensions\JsonNodeSchemaExtensions.cs (2)
320
var attributes = validations.OfType<
ValidationAttribute
>();
339
if (parameterInfo.GetCustomAttributes<
ValidationAttribute
>() is { } validationAttributes)
Services\Schemas\OpenApiSchemaService.cs (1)
122
if (propertyAttributes.OfType<
ValidationAttribute
>() is { } validationAttributes)
System.ComponentModel.Annotations (84)
System\ComponentModel\DataAnnotations\AllowedValuesAttribute.cs (1)
33
/// Determines whether a specified object is valid. (Overrides <see cref="
ValidationAttribute
.IsValid(object)" />)
System\ComponentModel\DataAnnotations\AsyncValidationAttribute.cs (5)
25
/// <param name="errorMessage">A non-localized error message to use in <see cref="
ValidationAttribute
.ErrorMessageString" />.</param>
32
/// Allows for providing a resource accessor function that will be used by the <see cref="
ValidationAttribute
.ErrorMessageString" />
42
/// Override of the base class <see cref="
ValidationAttribute
.IsValid(object?, ValidationContext)" /> method.
85
/// Sealed override of <see cref="
ValidationAttribute
.IsValid(object?)" /> that delegates to the
88
/// <see cref="
ValidationAttribute
.IsValid(object?, ValidationContext)" />.
System\ComponentModel\DataAnnotations\Base64StringAttribute.cs (1)
29
/// Determines whether a specified object is valid. (Overrides <see cref="
ValidationAttribute
.IsValid(object)" />)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (5)
26
/// Like any other <see cref="
ValidationAttribute
" />, its <see cref="IsValid(object, ValidationContext)" />
51
/// then the normal <see cref="
ValidationAttribute
.FormatErrorMessage" /> method will be called to compose the
80
/// and <see cref="
ValidationAttribute
.FormatErrorMessage" /> to return a summary error message.
128
/// Override of validation method. See <see cref="
ValidationAttribute
.IsValid(object, ValidationContext)" />.
188
/// Override of <see cref="
ValidationAttribute
.FormatErrorMessage" />
System\ComponentModel\DataAnnotations\DataTypeAttribute.cs (1)
98
/// Override of <see cref="
ValidationAttribute
.IsValid(object)" />
System\ComponentModel\DataAnnotations\DeniedValuesAttribute.cs (1)
33
/// Determines whether a specified object is valid. (Overrides <see cref="
ValidationAttribute
.IsValid(object)" />)
System\ComponentModel\DataAnnotations\LengthAttribute.cs (2)
34
/// Determines whether a specified object is valid. (Overrides <see cref="
ValidationAttribute
.IsValid(object)" />)
74
/// Applies formatting to a specified error message. (Overrides <see cref="
ValidationAttribute
.FormatErrorMessage" />)
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (2)
54
/// Determines whether a specified object is valid. (Overrides <see cref="
ValidationAttribute
.IsValid(object)" />)
91
/// Applies formatting to a specified error message. (Overrides <see cref="
ValidationAttribute
.FormatErrorMessage" />)
System\ComponentModel\DataAnnotations\MinLengthAttribute.cs (2)
36
/// Determines whether a specified object is valid. (Overrides <see cref="
ValidationAttribute
.IsValid(object)" />)
74
/// Applies formatting to a specified error message. (Overrides <see cref="
ValidationAttribute
.FormatErrorMessage" />)
System\ComponentModel\DataAnnotations\RangeAttribute.cs (1)
173
/// Override of <see cref="
ValidationAttribute
.FormatErrorMessage" />
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (2)
47
/// Override of <see cref="
ValidationAttribute
.IsValid(object)" />
80
/// Override of <see cref="
ValidationAttribute
.FormatErrorMessage" />
System\ComponentModel\DataAnnotations\RequiredAttribute.cs (2)
18
/// <see cref="
ValidationAttribute
.FormatErrorMessage" />
31
/// Override of <see cref="
ValidationAttribute
.IsValid(object)" />
System\ComponentModel\DataAnnotations\StringLengthAttribute.cs (2)
37
/// Override of <see cref="
ValidationAttribute
.IsValid(object)" />
63
/// Override of <see cref="
ValidationAttribute
.FormatErrorMessage" />
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (1)
485
/// can provide additional context to the <see cref="
ValidationAttribute
" /> being validated.
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (5)
14
/// Cache of <see cref="
ValidationAttribute
" />s
36
internal IEnumerable<
ValidationAttribute
> GetTypeValidationAttributes(ValidationContext validationContext)
62
internal IEnumerable<
ValidationAttribute
> GetPropertyValidationAttributes(ValidationContext validationContext)
152
ValidationAttributes = attributes.OfType<
ValidationAttribute
>();
156
internal IEnumerable<
ValidationAttribute
> ValidationAttributes { get; }
System\ComponentModel\DataAnnotations\ValidationException.cs (3)
24
public ValidationException(ValidationResult validationResult,
ValidationAttribute
? validatingAttribute,
37
public ValidationException(string? errorMessage,
ValidationAttribute
? validatingAttribute, object? value)
88
public
ValidationAttribute
? ValidationAttribute { get; }
System\ComponentModel\DataAnnotations\ValidationResult.cs (7)
14
/// <seealso cref="
ValidationAttribute
.GetValidationResult" />
34
/// provided on the <see cref="
ValidationAttribute
" />.
37
/// The user-visible error message. If null, <see cref="
ValidationAttribute
.GetValidationResult" />
38
/// will use <see cref="
ValidationAttribute
.FormatErrorMessage" /> for its error message.
47
/// This error message would override any error message provided on the <see cref="
ValidationAttribute
" />.
50
/// The user-visible error message. If null, <see cref="
ValidationAttribute
.GetValidationResult" />
51
/// will use <see cref="
ValidationAttribute
.FormatErrorMessage" /> for its error message.
System\ComponentModel\DataAnnotations\Validator.cs (41)
15
/// <see cref="
ValidationAttribute
" />
26
/// This method will test each <see cref="
ValidationAttribute
" /> associated with the property
78
/// This method evaluates all <see cref="
ValidationAttribute
" />s attached to the object instance's type. It also
105
/// This method evaluates all <see cref="
ValidationAttribute
" />s attached to the object instance's type. It also
108
/// is <c>true</c>, this method will also evaluate the <see cref="
ValidationAttribute
" />s for all the immediate
159
/// Tests whether the given value is valid against a specified list of <see cref="
ValidationAttribute
" />s.
162
/// This method will test each <see cref="
ValidationAttribute
" />s specified. If
183
/// The list of <see cref="
ValidationAttribute
" />s to validate this
188
ICollection<ValidationResult>? validationResults, IEnumerable<
ValidationAttribute
> validationAttributes)
237
/// This method evaluates all <see cref="
ValidationAttribute
" />s attached to the object's type.
261
/// This method evaluates all <see cref="
ValidationAttribute
" />s attached to the object's type.
298
/// <see cref="
ValidationAttribute
" />s.
301
/// This method evaluates the <see cref="
ValidationAttribute
" />s supplied until a validation error occurs,
310
/// <param name="validationAttributes">The list of <see cref="
ValidationAttribute
" />s to validate against this instance.</param>
314
IEnumerable<
ValidationAttribute
> validationAttributes)
330
/// This method will test each <see cref="
ValidationAttribute
" /> associated with the property
383
/// This method evaluates all <see cref="
ValidationAttribute
" />s attached to the object instance's type. It also
385
/// the <see cref="
ValidationAttribute
" />s on individual properties of the object unless
411
/// This method evaluates all <see cref="
ValidationAttribute
" />s attached to the object instance's type. It also
414
/// is <c>true</c>, this method will also evaluate the <see cref="
ValidationAttribute
" />s for all the immediate
474
/// Asynchronously tests whether the given value is valid against a specified list of <see cref="
ValidationAttribute
" />s.
477
/// This method will test each <see cref="
ValidationAttribute
" />s specified. If
488
/// <param name="validationAttributes">The list of <see cref="
ValidationAttribute
" />s to validate this <paramref name="value" /> against.</param>
495
IEnumerable<
ValidationAttribute
> validationAttributes,
544
/// This method evaluates all <see cref="
ValidationAttribute
" />s attached to the object's type.
570
/// This method evaluates all <see cref="
ValidationAttribute
" />s attached to the object's type.
609
/// <see cref="
ValidationAttribute
" />s.
613
/// <param name="validationAttributes">The list of <see cref="
ValidationAttribute
" />s to validate against this instance.</param>
621
IEnumerable<
ValidationAttribute
> validationAttributes,
782
foreach (
ValidationAttribute
attribute in attributes)
812
IEnumerable<
ValidationAttribute
> attributes,
824
foreach (
ValidationAttribute
attribute in attributes)
839
foreach (
ValidationAttribute
attr in attributes)
1089
foreach (
ValidationAttribute
attribute in attributes)
1162
ValidationContext validationContext, IEnumerable<
ValidationAttribute
> attributes, bool breakOnFirstError)
1171
foreach (
ValidationAttribute
attribute in attributes)
1186
foreach (
ValidationAttribute
attr in attributes)
1206
/// Tests whether a value is valid against a single <see cref="
ValidationAttribute
" /> using the
1218
private static bool TryValidate(object? value, ValidationContext validationContext,
ValidationAttribute
attribute,
1241
private readonly
ValidationAttribute
? _validationAttribute;
1243
internal ValidationError(
ValidationAttribute
? validationAttribute, object? value,
System.ComponentModel.DataAnnotations (1)
System.ComponentModel.DataAnnotations.cs (1)
42
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.DataAnnotations.
ValidationAttribute
))]