Click or drag to resize

ValidationContextT Class

Generic version of the ValidationContext class which represents a validation context for an entity.
Inheritance Hierarchy

Namespace:  Xploration.Validation
Assembly:  Xploration.Validation (in Xploration.Validation.dll) Version: 1.0.0-alpha1
Syntax
public class ValidationContext<T> : ValidationContext

Type Parameters

T
The type of the value/object to validate.

The ValidationContextT type exposes the following members.

Constructors
  NameDescription
Protected methodValidationContextT
Initializes a new instance of the ValidationContextT class.
Public methodValidationContextT(T)
Initializes a new instance of the ValidationContextT class with an entity that represents the new state.
Public methodValidationContextT(T, T)
Initializes a new instance of the ValidationContextT class with entities that represents the old and new state.
Top
Properties
  NameDescription
Public propertyAllResults
Gets a collection of all validation results that are registered in the chain of contexts.
(Inherited from ValidationContext.)
Public propertyIndex
Gets or sets the zero based index of an entity in a collection that the current context is related to. Returns -1 if an index is not applicable.
(Inherited from ValidationContext.)
Public propertyNewValue
Gets the new state of the entity.
Public propertyOldValue
Gets the old state of the entity.
Public propertyParent
Gets or sets the parent context of the current context.
(Inherited from ValidationContext.)
Public propertyResults
Gets a collection of validation results that are related to the current context.
(Inherited from ValidationContext.)
Public propertyTransition
Gets the transition between the old and new value.
(Inherited from ValidationContext.)
Public propertyUserState
Gets or sets an user defined state object.
(Inherited from ValidationContext.)
Top
Methods
  NameDescription
Public methodStatic memberCheckContextCompatibility
Checks if the given non generic context its values are compatible with the generic version of the context. If the given context is not compatible an InvalidCastException will be thrown.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRegisterResult(ValidationResult)
Registers a validation result to the chain of contexts.
(Inherited from ValidationContext.)
Public methodRegisterResult(IValidator, Boolean, Object)
Registers a validation result for the current context.
(Inherited from ValidationContext.)
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Top
Extension Methods
  NameDescription
Public Extension MethodCastErrorsE
Returns error entities of the context its validation results that are of type E.
(Defined by ValidationContextExtensions.)
Public Extension MethodGetChildResults
Gets a collection of validation results from child contexts.
(Defined by ValidationContextExtensions.)
Public Extension MethodGetRootContext
Searches for the root context starting with the current context.
(Defined by ValidationContextExtensions.)
Public Extension MethodHasFailures
Determines if the context contains validation failures.
(Defined by ValidationContextExtensions.)
Public Extension MethodIsChildOf
Determines if the current context is a direct or indirect child of the given context.
(Defined by ValidationContextExtensions.)
Public Extension MethodIsRootContext
Determines if the current context is the root context.
(Defined by ValidationContextExtensions.)
Top
See Also