Class ContextValidatorWrapper<TInstance, TContext>
Class that encapsulates an instance of IValidate<T> of IContextValidate<TInstance, TContext>
Namespace: EPiServer.Validation.Internal
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public class ContextValidatorWrapper<TInstance, TContext> : ValidatorWrapperType Parameters
| Name | Description | 
|---|---|
| TInstance | The type the validator validates | 
| TContext | The context the validator is registered for | 
Constructors
ContextValidatorWrapper(IValidate)
Initializes a new instance of the ContextValidatorWrapper<TInstance, TContext> class.
Declaration
public ContextValidatorWrapper(IValidate implementation)Parameters
| Type | Name | Description | 
|---|---|---|
| IValidate | implementation | The implementation. | 
Properties
ContextType
The context type for the IContextValidate<TInstance, TContext>
Declaration
public override Type ContextType { get; }Property Value
| Type | Description | 
|---|---|
| System.Type | 
Overrides
EncapsulatedValidator
Gets the encapsulated validator.
Declaration
public override object EncapsulatedValidator { get; }Property Value
| Type | Description | 
|---|---|
| System.Object | The encapsulated validator. | 
Overrides
TypeToValidate
Gets the type to validate.
Declaration
public override Type TypeToValidate { get; }Property Value
| Type | Description | 
|---|---|
| System.Type | The type to validate. | 
Overrides
Methods
Validate(Object)
Validates the specified instance.
Declaration
public override IEnumerable<ValidationError> Validate(object instance)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | instance | The instance. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<ValidationError> | 
Overrides
Validate(Object, Object)
Calls the wrapped validator with conext if context is supported.
Declaration
public override IEnumerable<ValidationError> Validate(object instance, object context)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | instance | The instance to validate | 
| System.Object | context | The context for the validation | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<ValidationError> | 
