C# Class FluentValidation.Validators.PropertyValidator

Inheritance: IPropertyValidator
Mostra file Open project: JeremySkinner/FluentValidation Class Usage Examples

Public Methods

Method Description
Validate ( PropertyValidatorContext context ) : IEnumerable
ValidateAsync ( PropertyValidatorContext context, CancellationToken cancellation ) : Task>

Protected Methods

Method Description
CreateValidationError ( PropertyValidatorContext context ) : ValidationFailure

Creates an error validation result for this validator.

IsValid ( PropertyValidatorContext context ) : bool
IsValidAsync ( PropertyValidatorContext context, CancellationToken cancellation ) : Task
PrepareMessageFormatterForValidationError ( PropertyValidatorContext context ) : void

Prepares the MessageFormatter of context for an upcoming ValidationFailure.

PropertyValidator ( Expression errorMessageResourceSelector ) : System.Threading
PropertyValidator ( string errorMessage ) : System.Threading
PropertyValidator ( string errorMessageResourceName, Type errorMessageResourceType ) : System.Threading

Private Methods

Method Description
BuildErrorMessage ( PropertyValidatorContext context ) : string

Method Details

CreateValidationError() protected method

Creates an error validation result for this validator.
protected CreateValidationError ( PropertyValidatorContext context ) : ValidationFailure
context PropertyValidatorContext The validator context
return ValidationFailure

IsValid() protected abstract method

protected abstract IsValid ( PropertyValidatorContext context ) : bool
context PropertyValidatorContext
return bool

IsValidAsync() protected method

protected IsValidAsync ( PropertyValidatorContext context, CancellationToken cancellation ) : Task
context PropertyValidatorContext
cancellation CancellationToken
return Task

PrepareMessageFormatterForValidationError() protected method

Prepares the MessageFormatter of context for an upcoming ValidationFailure.
protected PrepareMessageFormatterForValidationError ( PropertyValidatorContext context ) : void
context PropertyValidatorContext The validator context
return void

PropertyValidator() protected method

protected PropertyValidator ( Expression errorMessageResourceSelector ) : System.Threading
errorMessageResourceSelector Expression
return System.Threading

PropertyValidator() protected method

protected PropertyValidator ( string errorMessage ) : System.Threading
errorMessage string
return System.Threading

PropertyValidator() protected method

protected PropertyValidator ( string errorMessageResourceName, Type errorMessageResourceType ) : System.Threading
errorMessageResourceName string
errorMessageResourceType System.Type
return System.Threading

Validate() public method

public Validate ( PropertyValidatorContext context ) : IEnumerable
context PropertyValidatorContext
return IEnumerable

ValidateAsync() public method

public ValidateAsync ( PropertyValidatorContext context, CancellationToken cancellation ) : Task>
context PropertyValidatorContext
cancellation CancellationToken
return Task>