Table of Contents

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

validator IValidator<T>

The validator to use for validation.

instance T

The object instance to validate.

ruleSet string

The rule set to use for validation.

properties string[]

The properties to include in the validation.

Returns

ValidationResult

The validation result.

Type Parameters

T

The 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

validator IValidator<T>

The validator to use for validation.

instance T

The object instance to validate.

ruleSet string

The rule set to use for validation.

propertyExpressions Expression<Func<T, object>>[]

The property expressions to include in the validation.

Returns

ValidationResult

The validation result.

Type Parameters

T

The 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

validator IValidator<T>

The validator to use for validation.

instance T

The object instance to validate.

ruleSet string

The rule set to use for validation.

propertyName string

The property name to include in the validation.

Returns

ValidationResult

The validation result.

Type Parameters

T

The type of the object to validate.