Interface IInfoValidator<TInfo>
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Declares members for validation of info objects.
public interface IInfoValidator<TInfo> where TInfo : AbstractInfoBase<TInfo>, new()
Type Parameters
TInfoType of info object validated.
- Extension Methods
Remarks
Implement this interface for a particular TInfo to perform domain specific validation and register the implementation into the collection of services.
The system invokes the registered validators upon validating TInfo.
Registered implementations must be singletons.
Methods
Validate(TInfo)
Validates whether the info object's state satisfies domain specific constraints and returns the validation result.
InfoValidationResult Validate(TInfo info)
Parameters
infoTInfoInfo object to be validated.
Returns
- InfoValidationResult
Returns validation result with IsValid set to true, if
infois valid. Otherwise returns result with the flag set to false and a corresponding error message.
Exceptions
- ArgumentNullException
Thrown when
infois null.