Method Validate
- Namespace
- Innova.Data.Validation
- Assembly
- Innova.Data.dll
Validate<T>(IValidator<T>, T, string, string[])
Validates an object using the specified validator, rule set, and properties.
public static ValidationResult Validate<T>(this IValidator<T> validator, T instance, string ruleSet, string[] properties)
Parameters
validatorIValidator<T>The validator to use for validation.
instanceTThe object instance to validate.
ruleSetstringThe rule set to use for validation.
propertiesstring[]The properties to include in the validation.
Returns
- ValidationResult
The validation result.
Type Parameters
TThe type of the object to validate.
Validate<T>(IValidator<T>, T, string, Expression<Func<T, object>>[])
Validates an object using the specified validator, rule set, and property expressions.
public static ValidationResult Validate<T>(this IValidator<T> validator, T instance, string ruleSet, Expression<Func<T, object>>[] propertyExpressions)
Parameters
validatorIValidator<T>The validator to use for validation.
instanceTThe object instance to validate.
ruleSetstringThe rule set to use for validation.
propertyExpressionsExpression<Func<T, object>>[]The property expressions to include in the validation.
Returns
- ValidationResult
The validation result.
Type Parameters
TThe type of the object to validate.
Validate<T>(IValidator<T>, T, string, string)
Validates an object using the specified validator, rule set, and property name.
public static ValidationResult Validate<T>(this IValidator<T> validator, T instance, string ruleSet, string propertyName)
Parameters
validatorIValidator<T>The validator to use for validation.
instanceTThe object instance to validate.
ruleSetstringThe rule set to use for validation.
propertyNamestringThe property name to include in the validation.
Returns
- ValidationResult
The validation result.
Type Parameters
TThe type of the object to validate.