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)
13public class StringLengthAttribute : ValidationAttribute
126 references to ValidationAttribute
Microsoft.AspNetCore.Components.Endpoints (9)
Forms\ClientValidationCache.cs (1)
226var 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) 120private static bool TryWriteBuiltInRule(ClientValidationDataWriter writer, ValidationAttribute validationAttribute, string errorMessage)
Forms\DataAnnotationsLocalizer.cs (3)
49ValidationAttribute attribute, 76private string? GetErrorMessageKey(ValidationAttribute attribute, string memberName, Type type) 98private static string FormatMessage(ValidationAttribute attribute, CultureInfo culture, string messageTemplate, string displayName)
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)
Microsoft.Extensions.Validation (1)
IValidationMessageFormatter.cs (1)
9/// When implemented by a custom attribute derived from <see cref="System.ComponentModel.DataAnnotations.ValidationAttribute"/>
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. 79/// Sealed override of <see cref="ValidationAttribute.IsValid(object?)" /> that delegates to the 82/// <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)
36/// Override of <see cref="ValidationAttribute.IsValid(object)" /> 62/// Override of <see cref="ValidationAttribute.FormatErrorMessage" />
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (1)
464/// 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 (3)
24public ValidationException(ValidationResult validationResult, ValidationAttribute? validatingAttribute, 37public ValidationException(string? errorMessage, ValidationAttribute? validatingAttribute, object? value) 88public 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 188ICollection<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> 314IEnumerable<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> 495IEnumerable<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> 621IEnumerable<ValidationAttribute> validationAttributes, 782foreach (ValidationAttribute attribute in attributes) 812IEnumerable<ValidationAttribute> attributes, 824foreach (ValidationAttribute attribute in attributes) 839foreach (ValidationAttribute attr in attributes) 1089foreach (ValidationAttribute attribute in attributes) 1162ValidationContext validationContext, IEnumerable<ValidationAttribute> attributes, bool breakOnFirstError) 1171foreach (ValidationAttribute attribute in attributes) 1186foreach (ValidationAttribute attr in attributes) 1206/// Tests whether a value is valid against a single <see cref="ValidationAttribute" /> using the 1218private static bool TryValidate(object? value, ValidationContext validationContext, ValidationAttribute attribute, 1241private readonly ValidationAttribute? _validationAttribute; 1243internal 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))]