System.ComponentModel.DataAnnotations.Validator
Defines a helper class that can be used to validate objects, properties, and methods when it is included in their associated ValidationAttribute attributes.
public static bool TryValidateObject(object instance, ValidationContext validationContext, ICollection<ValidationResult> validationResults)
Determines whether the specified object is valid using the validation context and validation results collection.
public static bool TryValidateObject(object instance, ValidationContext validationContext, ICollection<ValidationResult> validationResults, bool validateAllProperties)
Determines whether the specified object is valid using the validation context, validation results collection, and a value that specifies whether to validate all properties.
public static bool TryValidateProperty(object value, ValidationContext validationContext, ICollection<ValidationResult> validationResults)
Validates the property.
public static bool TryValidateValue(object value, ValidationContext validationContext, ICollection<ValidationResult> validationResults, IEnumerable<ValidationAttribute> validationAttributes)
Returns a value that indicates whether the specified value is valid with the specified attributes.
Determines whether the specified object is valid using the validation context.
public static void ValidateObject(object instance, ValidationContext validationContext, bool validateAllProperties)
Determines whether the specified object is valid using the validation context, and a value that specifies whether to validate all properties.
Validates the property.
public static void ValidateValue(object value, ValidationContext validationContext, IEnumerable<ValidationAttribute> validationAttributes)
Validates the specified attributes.