29 types derived from ValidationAttribute
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
RemoteAttributeBase.cs (1)
26public abstract class RemoteAttributeBase : ValidationAttribute, IClientModelValidator
Microsoft.Extensions.Compliance.Redaction (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29internal sealed class LengthAttribute : ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23internal sealed class TimeSpanAttribute : ValidationAttribute
Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29internal sealed class LengthAttribute : ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23internal sealed class TimeSpanAttribute : ValidationAttribute
Microsoft.Extensions.Diagnostics.Probes (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29internal sealed class LengthAttribute : ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23internal sealed class TimeSpanAttribute : ValidationAttribute
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29internal sealed class LengthAttribute : ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23internal sealed class TimeSpanAttribute : ValidationAttribute
Microsoft.Extensions.Http.Resilience (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29internal sealed class LengthAttribute : ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23internal sealed class TimeSpanAttribute : ValidationAttribute
Microsoft.Extensions.Telemetry (2)
src\Shared\Data.Validation\LengthAttribute.cs (1)
29internal sealed class LengthAttribute : ValidationAttribute
src\Shared\Data.Validation\TimeSpanAttribute.cs (1)
23internal sealed class TimeSpanAttribute : ValidationAttribute
Shared (2)
Data.Validation\LengthAttribute.cs (1)
29internal sealed class LengthAttribute : ValidationAttribute
Data.Validation\TimeSpanAttribute.cs (1)
23internal sealed class TimeSpanAttribute : ValidationAttribute
System.ComponentModel.Annotations (14)
System\ComponentModel\DataAnnotations\AllowedValuesAttribute.cs (1)
12public class AllowedValuesAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\AsyncValidationAttribute.cs (1)
13public abstract class AsyncValidationAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\Base64StringAttribute.cs (1)
16public class Base64StringAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\CompareAttribute.cs (1)
12public class CompareAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
58public sealed class CustomValidationAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\DataTypeAttribute.cs (1)
16public class DataTypeAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\DeniedValuesAttribute.cs (1)
12public class DeniedValuesAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\LengthAttribute.cs (1)
13public class LengthAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
17public class MaxLengthAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\MinLengthAttribute.cs (1)
14public class MinLengthAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\RangeAttribute.cs (1)
14public class RangeAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (1)
15public class RegularExpressionAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\RequiredAttribute.cs (1)
11public class RequiredAttribute : ValidationAttribute
System\ComponentModel\DataAnnotations\StringLengthAttribute.cs (1)
14public class StringLengthAttribute : ValidationAttribute
128 references to ValidationAttribute
Microsoft.AspNetCore.Components.Endpoints (8)
Forms\ClientValidationCache.cs (1)
224var validationAttributes = property.GetCustomAttributes<ValidationAttribute>(inherit: true).ToArray();
Forms\ClientValidationFieldMetadata.cs (2)
13ValidationAttribute[] validationAttributes, 20public ValidationAttribute[] ValidationAttributes { get; } = validationAttributes;
Forms\DataAnnotationsClientValidationProvider.cs (2)
88foreach (var attribute in fieldMetadata.ValidationAttributes) 119private static bool TryWriteBuiltInRule(ClientValidationDataWriter writer, ValidationAttribute validationAttribute, string errorMessage)
Forms\DataAnnotationsLocalizer.cs (2)
48ValidationAttribute attribute, 84ValidationAttribute 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> 18where 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 73var attribute = validatorItem.ValidatorMetadata as ValidationAttribute;
DataAnnotationsMetadataProvider.cs (2)
378foreach (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> 29ValidationAttribute attribute, 43public 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 65if (!(validatorItem.ValidatorMetadata is ValidationAttribute attribute)) 108if (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"/> 22IAttributeAdapter? GetAttributeAdapter(ValidationAttribute attribute, IStringLocalizer? stringLocalizer);
ValidationAttributeAdapterOfTAttribute.cs (1)
16where TAttribute : ValidationAttribute
ValidationAttributeAdapterProvider.cs (1)
20public 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> 18public 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)
320var attributes = validations.OfType<ValidationAttribute>(); 339if (parameterInfo.GetCustomAttributes<ValidationAttribute>() is { } validationAttributes)
Services\Schemas\OpenApiSchemaService.cs (1)
122if (propertyAttributes.OfType<ValidationAttribute>() is { } validationAttributes)
System.ComponentModel.Annotations (88)
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 (6)
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 is used by the <see cref="ValidationAttribute.ErrorMessageString" /> 42/// Override of the base class <see cref="ValidationAttribute.IsValid(object?, ValidationContext)" /> method. 71/// contextless <see cref="ValidationAttribute.IsValid(object?)" /> overload invokes this method. 113/// Sealed override of <see cref="ValidationAttribute.IsValid(object?)" /> that delegates to the 116/// <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 36internal IEnumerable<ValidationAttribute> GetTypeValidationAttributes(ValidationContext validationContext) 62internal IEnumerable<ValidationAttribute> GetPropertyValidationAttributes(ValidationContext validationContext) 152ValidationAttributes = attributes.OfType<ValidationAttribute>(); 156internal IEnumerable<ValidationAttribute> ValidationAttributes { get; }
System\ComponentModel\DataAnnotations\ValidationException.cs (6)
24public ValidationException(ValidationResult validationResult, ValidationAttribute? validatingAttribute, 37public ValidationException(string? errorMessage, ValidationAttribute? validatingAttribute, object? value) 49/// <see cref="ValidationException(string, ValidationAttribute, object)" />. 60/// <see cref="ValidationException(string, ValidationAttribute, object)" /> overload. 76/// <see cref="ValidationException(string, ValidationAttribute, object)" />. 100public 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 110/// This method evaluates all <see cref="ValidationAttribute" />s attached to the object instance's type. It also 113/// is <c>true</c>, this method will also evaluate the <see cref="ValidationAttribute" />s for all the immediate 169/// Tests whether the given value is valid against a specified list of <see cref="ValidationAttribute" />s. 172/// This method will test each <see cref="ValidationAttribute" />s specified. If 193/// The list of <see cref="ValidationAttribute" />s to validate this 198ICollection<ValidationResult>? validationResults, IEnumerable<ValidationAttribute> validationAttributes) 247/// This method evaluates all <see cref="ValidationAttribute" />s attached to the object's type. 276/// This method evaluates all <see cref="ValidationAttribute" />s attached to the object's type. 318/// <see cref="ValidationAttribute" />s. 321/// This method evaluates the <see cref="ValidationAttribute" />s supplied until a validation error occurs, 330/// <param name="validationAttributes">The list of <see cref="ValidationAttribute" />s to validate against this instance.</param> 334IEnumerable<ValidationAttribute> validationAttributes) 350/// This method tests each <see cref="ValidationAttribute" /> associated with the property 411/// This method evaluates all <see cref="ValidationAttribute" />s attached to the object instance's type. It also 413/// the <see cref="ValidationAttribute" />s on individual properties of the object unless 450/// This method evaluates all <see cref="ValidationAttribute" />s attached to the object instance's type. It also 453/// is <c>true</c>, this method also evaluates the <see cref="ValidationAttribute" />s for all the immediate 525/// Asynchronously tests whether the given value is valid against a specified list of <see cref="ValidationAttribute" />s. 528/// This method tests each specified <see cref="ValidationAttribute" />. If 541/// <param name="validationAttributes">The list of <see cref="ValidationAttribute" />s to validate this <paramref name="value" /> against.</param> 551IEnumerable<ValidationAttribute> validationAttributes, 610/// If property validation succeeds, the method evaluates the <see cref="ValidationAttribute" /> 653/// the method evaluates the <see cref="ValidationAttribute" /> attributes attached to the object's type. 704/// <see cref="ValidationAttribute" />s. 708/// <param name="validationAttributes">The list of <see cref="ValidationAttribute" />s to validate this <paramref name="value" /> against.</param> 718IEnumerable<ValidationAttribute> validationAttributes, 879foreach (ValidationAttribute attribute in attributes) 909IEnumerable<ValidationAttribute> attributes, 921foreach (ValidationAttribute attribute in attributes) 936foreach (ValidationAttribute attr in attributes) 1186foreach (ValidationAttribute attribute in attributes) 1259ValidationContext validationContext, IEnumerable<ValidationAttribute> attributes, bool breakOnFirstError) 1268foreach (ValidationAttribute attribute in attributes) 1283foreach (ValidationAttribute attr in attributes) 1303/// Tests whether a value is valid against a single <see cref="ValidationAttribute" /> using the 1315private static bool TryValidate(object? value, ValidationContext validationContext, ValidationAttribute attribute, 1338private readonly ValidationAttribute? _validationAttribute; 1340internal 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))]