Class MessageSupportValidatorWrapper
A service which wraps a validator with functionality which adds message support.
Inheritance
System.Object
MessageSupportValidatorWrapper
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 MessageSupportValidatorWrapper : IWrapsValidatorWithMessageSupport
Constructors
| Improve this Doc View SourceMessageSupportValidatorWrapper(IAddsFailureMessagesToResult, IGetsResolvedValidationOptions)
Initialises a new instance of MessageSupportValidatorWrapper.
Declaration
public MessageSupportValidatorWrapper(IAddsFailureMessagesToResult failureMessageEnricher, IGetsResolvedValidationOptions optionsResolver)
Parameters
Type | Name | Description |
---|---|---|
IAddsFailureMessagesToResult | failureMessageEnricher | The failure message enriching service. |
IGetsResolvedValidationOptions | optionsResolver | An options resolving service. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Methods
| Improve this Doc View SourceGetValidatorWithMessageSupport(IValidator)
Wraps a non-generic validator with message-enriching behaviour.
Declaration
public IValidator GetValidatorWithMessageSupport(IValidator validator)
Parameters
Type | Name | Description |
---|---|---|
IValidator | validator | The validator instance to wrap. |
Returns
Type | Description |
---|---|
IValidator | The validator, with added message support. |
GetValidatorWithMessageSupport<TValidated>(IValidator<TValidated>)
Wraps a generic validator with message-enriching behaviour.
Declaration
public IValidator<TValidated> GetValidatorWithMessageSupport<TValidated>(IValidator<TValidated> validator)
Parameters
Type | Name | Description |
---|---|---|
IValidator<TValidated> | validator | The validator instance to wrap. |
Returns
Type | Description |
---|---|
IValidator<TValidated> | The validator, with added message support. |
Type Parameters
Name | Description |
---|---|
TValidated | The validated type. |