10 types derived from ValidationAttribute
System.ComponentModel.DataAnnotations (9)
DataAnnotations\CompareAttribute.cs (1)
14
public class CompareAttribute :
ValidationAttribute
{
DataAnnotations\CustomValidationAttribute.cs (1)
47
public sealed class CustomValidationAttribute :
ValidationAttribute
{
DataAnnotations\DataTypeAttribute.cs (1)
13
public class DataTypeAttribute :
ValidationAttribute
{
DataAnnotations\MaxLengthAttribute.cs (1)
11
public class MaxLengthAttribute :
ValidationAttribute
{
DataAnnotations\MinLengthAttribute.cs (1)
11
public class MinLengthAttribute :
ValidationAttribute
{
DataAnnotations\RangeAttribute.cs (1)
12
public class RangeAttribute :
ValidationAttribute
{
DataAnnotations\RegularExpressionAttribute.cs (1)
12
public class RegularExpressionAttribute :
ValidationAttribute
{
DataAnnotations\RequiredAttribute.cs (1)
10
public class RequiredAttribute :
ValidationAttribute
{
DataAnnotations\StringLengthAttribute.cs (1)
11
public class StringLengthAttribute :
ValidationAttribute
{
System.Web (1)
Security\MembershipPasswordAttribute.cs (1)
15
public class MembershipPasswordAttribute :
ValidationAttribute
{
75 references to ValidationAttribute
System.ComponentModel.DataAnnotations (61)
DataAnnotations\CustomValidationAttribute.cs (5)
20
/// Like any other <see cref="
ValidationAttribute
"/>, its <see cref="IsValid(object, ValidationContext)"/>
43
/// then the normal <see cref="
ValidationAttribute
.FormatErrorMessage"/> method will be called to compose the error message.
71
/// and <see cref="
ValidationAttribute
.FormatErrorMessage"/> to return a summary error message.
120
/// Override of validation method. See <see cref="
ValidationAttribute
.IsValid(object, ValidationContext)"/>.
173
/// Override of <see cref="
ValidationAttribute
.FormatErrorMessage"/>
DataAnnotations\DataTypeAttribute.cs (1)
87
/// Override of <see cref="
ValidationAttribute
.IsValid(object)"/>
DataAnnotations\MaxLengthAttribute.cs (2)
45
/// Determines whether a specified object is valid. (Overrides <see cref = "
ValidationAttribute
.IsValid(object)" />)
78
/// Applies formatting to a specified error message. (Overrides <see cref = "
ValidationAttribute
.FormatErrorMessage" />)
DataAnnotations\MinLengthAttribute.cs (2)
30
/// Determines whether a specified object is valid. (Overrides <see cref = "
ValidationAttribute
.IsValid(object)" />)
63
/// Applies formatting to a specified error message. (Overrides <see cref = "
ValidationAttribute
.FormatErrorMessage" />)
DataAnnotations\RangeAttribute.cs (1)
123
/// Override of <see cref="
ValidationAttribute
.FormatErrorMessage"/>
DataAnnotations\RegularExpressionAttribute.cs (2)
47
/// Override of <see cref="
ValidationAttribute
.IsValid(object)"/>
78
/// Override of <see cref="
ValidationAttribute
.FormatErrorMessage"/>
DataAnnotations\RequiredAttribute.cs (2)
14
/// <remarks>This constructor selects a reasonable default error message for <see cref="
ValidationAttribute
.FormatErrorMessage"/></remarks>
25
/// Override of <see cref="
ValidationAttribute
.IsValid(object)"/>
DataAnnotations\StringLengthAttribute.cs (2)
38
/// Override of <see cref="
ValidationAttribute
.IsValid(object)"/>
61
/// Override of <see cref="
ValidationAttribute
.FormatErrorMessage"/>
DataAnnotations\ValidationAttribute.cs (1)
435
/// can provide additional context to the <see cref="
ValidationAttribute
"/> being validated.
DataAnnotations\ValidationAttributeStore.cs (8)
10
/// Cache of <see cref="
ValidationAttribute
"/>s
35
internal IEnumerable<
ValidationAttribute
> GetTypeValidationAttributes(ValidationContext validationContext) {
57
internal IEnumerable<
ValidationAttribute
> GetPropertyValidationAttributes(ValidationContext validationContext) {
144
private static IEnumerable<
ValidationAttribute
> _emptyValidationAttributeEnumerable = new
ValidationAttribute
[0];
146
private IEnumerable<
ValidationAttribute
> _validationAttributes;
149
this._validationAttributes = attributes.OfType<
ValidationAttribute
>();
153
internal IEnumerable<
ValidationAttribute
> ValidationAttributes {
DataAnnotations\ValidationException.cs (3)
24
public
ValidationAttribute
ValidationAttribute { get; private set; }
52
public ValidationException(ValidationResult validationResult,
ValidationAttribute
validatingAttribute, object value)
63
public ValidationException(string errorMessage,
ValidationAttribute
validatingAttribute, object value)
DataAnnotations\ValidationResult.cs (7)
11
/// <seealso cref="
ValidationAttribute
.GetValidationResult"/>
38
/// provided on the <see cref="
ValidationAttribute
"/>.
40
/// <param name="errorMessage">The user-visible error message. If null, <see cref="
ValidationAttribute
.GetValidationResult"/>
41
/// will use <see cref="
ValidationAttribute
.FormatErrorMessage"/> for its error message.</param>
48
/// This error message would override any error message provided on the <see cref="
ValidationAttribute
"/>.
50
/// <param name="errorMessage">The user-visible error message. If null, <see cref="
ValidationAttribute
.GetValidationResult"/>
51
/// will use <see cref="
ValidationAttribute
.FormatErrorMessage"/> for its error message.</param>
DataAnnotations\Validator.cs (25)
10
/// Helper class to validate objects, properties and other values using their associated <see cref="
ValidationAttribute
"/>
20
/// This method will test each <see cref="
ValidationAttribute
"/> associated with the property
49
IEnumerable<
ValidationAttribute
> attributes = _store.GetPropertyValidationAttributes(validationContext);
66
/// This method evaluates all <see cref="
ValidationAttribute
"/>s attached to the object instance's type. It also
90
/// This method evaluates all <see cref="
ValidationAttribute
"/>s attached to the object instance's type. It also
92
/// is <c>true</c>, this method will also evaluate the <see cref="
ValidationAttribute
"/>s for all the immediate properties
137
/// Tests whether the given value is valid against a specified list of <see cref="
ValidationAttribute
"/>s.
140
/// This method will test each <see cref="
ValidationAttribute
"/>s specified . If
157
/// <param name="validationAttributes">The list of <see cref="
ValidationAttribute
"/>s to validate this <paramref name="value"/> against.</param>
159
public static bool TryValidateValue(object value, ValidationContext validationContext, ICollection<ValidationResult> validationResults, IEnumerable<
ValidationAttribute
> validationAttributes) {
186
IEnumerable<
ValidationAttribute
> attributes = _store.GetPropertyValidationAttributes(validationContext);
198
/// This method evaluates all <see cref="
ValidationAttribute
"/>s attached to the object's type.
215
/// This method evaluates all <see cref="
ValidationAttribute
"/>s attached to the object's type.
244
/// Throw a <see cref="ValidationException"/> if the given value is not valid for the <see cref="
ValidationAttribute
"/>s.
247
/// This method evaluates the <see cref="
ValidationAttribute
"/>s supplied until a validation error occurs,
255
/// <param name="validationAttributes">The list of <see cref="
ValidationAttribute
"/>s to validate against this instance.</param>
258
public static void ValidateValue(object value, ValidationContext validationContext, IEnumerable<
ValidationAttribute
> validationAttributes) {
355
IEnumerable<
ValidationAttribute
> attributes = _store.GetTypeValidationAttributes(validationContext);
393
IEnumerable<
ValidationAttribute
> attributes = _store.GetPropertyValidationAttributes(property.Key);
472
private static IEnumerable<ValidationError> GetValidationErrors(object value, ValidationContext validationContext, IEnumerable<
ValidationAttribute
> attributes, bool breakOnFirstError) {
490
foreach (
ValidationAttribute
attr in attributes) {
506
/// Tests whether a value is valid against a single <see cref="
ValidationAttribute
"/> using the <see cref="ValidationContext"/>.
514
private static bool TryValidate(object value, ValidationContext validationContext,
ValidationAttribute
attribute, out ValidationError validationError) {
534
internal ValidationError(
ValidationAttribute
validationAttribute, object value, ValidationResult validationResult) {
542
internal
ValidationAttribute
ValidationAttribute { get; set; }
System.Web (12)
ModelBinding\DataAnnotationsModelValidator.cs (3)
11
public DataAnnotationsModelValidator(ModelMetadata metadata, ModelBindingExecutionContext context,
ValidationAttribute
attribute)
21
protected internal
ValidationAttribute
Attribute { get; private set; }
52
internal static ModelValidator Create(ModelMetadata metadata, ModelBindingExecutionContext context,
ValidationAttribute
attribute) {
ModelBinding\DataAnnotationsModelValidator`1.cs (1)
4
public class DataAnnotationsModelValidator<TAttribute> : DataAnnotationsModelValidator where TAttribute :
ValidationAttribute
{
ModelBinding\DataAnnotationsModelValidatorProvider.cs (7)
13
public delegate ModelValidator DataAnnotationsModelValidationFactory(ModelMetadata metadata, ModelBindingExecutionContext context,
ValidationAttribute
attribute);
20
/// for attributes which derive from <see cref="
ValidationAttribute
"/>. It also provides
94
foreach (
ValidationAttribute
attribute in attributes.OfType<
ValidationAttribute
>()) {
153
ConstructorInfo constructor = GetAttributeAdapterConstructor(typeof(
ValidationAttribute
), adapterType);
206
if (!typeof(
ValidationAttribute
).IsAssignableFrom(attributeType)) {
212
typeof(
ValidationAttribute
).FullName
Security\MembershipPasswordAttribute.cs (1)
154
/// Overrider of <see cref="
ValidationAttribute
.IsValid(object,validationContext)"/>.
System.Web.DynamicData (2)
DynamicData\DynamicValidator.cs (2)
151
foreach (
var
attrib in Column.Attributes.Cast<Attribute>().OfType<
ValidationAttribute
>()) {