Click or drag to resize
IValidator Interface
Declares members of a validator.

Namespace: CMS.Base
Assembly: CMS.Base (in CMS.Base.dll) Version: 12.0.0
Syntax
C#
public interface IValidator

The IValidator type exposes the following members.

Properties
  NameDescription
Public propertyErrors
Gets an enumeration of validation errors associated with this validator. An empty enumeration is returned if validation succeeded.
Public propertyIsValid
Gets a value indicating whether validation succeeded.
Top
Methods
  NameDescription
Public methodValidate
Performs validation on this validator. The validation result is returned and can be later retrieved via IsValid property. When validation fails, an enumeration of errors associated with the validation is available in Errors.
Top
Extension Methods
  NameDescription
Public Extension MethodContainsTValidatorError
Returns a value indicating whether a validation error of type TValidatorError is in Errors.
(Defined by IValidatorExtensions.)
Public Extension MethodFirstErrorType
Returns Type of the first validation error in Errors.
(Defined by IValidatorExtensions.)
Public Extension MethodGetErrorMessages
Returns collection of localized error messages that occurred during validation.
(Defined by IValidatorExtensions.)
Top
Remarks
Validators represent a reusable validation logic.
See Also