Class ExceptionThrowingValidatorWrapper
A service which wraps instances of validators with exception-throwing behaviour.
Inheritance
System.Object
ExceptionThrowingValidatorWrapper
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CSF.Validation
Assembly: CSF.Validation.dll
Syntax
public class ExceptionThrowingValidatorWrapper : IWrapsValidatorWithExceptionBehaviour
Constructors
| Improve this Doc View SourceExceptionThrowingValidatorWrapper(IGetsResolvedValidationOptions)
Initialises a new instance of ExceptionThrowingValidatorWrapper.
Declaration
public ExceptionThrowingValidatorWrapper(IGetsResolvedValidationOptions optionsResolver)
Parameters
Type | Name | Description |
---|---|---|
IGetsResolvedValidationOptions | optionsResolver | An options resolver. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Methods
| Improve this Doc View SourceWrapValidator(IValidator)
Wraps a non-generic validator with the appropriate behaviour.
Declaration
public IValidator WrapValidator(IValidator validator)
Parameters
Type | Name | Description |
---|---|---|
IValidator | validator | The validator instance to wrap. |
Returns
Type | Description |
---|---|
IValidator | A validator, with added exception-throwing behaviour. |
WrapValidator<TValidated>(IValidator<TValidated>)
Wraps a generic validator with the appropriate behaviour.
Declaration
public IValidator<TValidated> WrapValidator<TValidated>(IValidator<TValidated> validator)
Parameters
Type | Name | Description |
---|---|---|
IValidator<TValidated> | validator | The validator instance to wrap. |
Returns
Type | Description |
---|---|
IValidator<TValidated> | A validator, with added exception-throwing behaviour. |
Type Parameters
Name | Description |
---|---|
TValidated | The validated type. |