Show / Hide Table of Contents

Class ValidatorBuilderContextFactory

A factory service for getting instances of ValidatorBuilderContext.

Inheritance
System.Object
ValidatorBuilderContextFactory
Implements
IGetsValidatorBuilderContext
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.ValidatorBuilding
Assembly: CSF.Validation.dll
Syntax
public class ValidatorBuilderContextFactory : IGetsValidatorBuilderContext

Constructors

| Improve this Doc View Source

ValidatorBuilderContextFactory(IStaticallyReflects)

Initialises a new instance of ValidatorBuilderContextFactory.

Declaration
public ValidatorBuilderContextFactory(IStaticallyReflects reflect)
Parameters
Type Name Description
CSF.Reflection.IStaticallyReflects reflect

A service which provides static reflection.

Methods

| Improve this Doc View Source

GetContextForCollection(ValidatorBuilderContext, Type)

Gets a validator builder context for validating items within a collection.

Declaration
public ValidatorBuilderContext GetContextForCollection(ValidatorBuilderContext collectionContext, Type collectionItemType)
Parameters
Type Name Description
ValidatorBuilderContext collectionContext

A validation context representing the collection itself.

System.Type collectionItemType

The type of items within the collection.

Returns
Type Description
ValidatorBuilderContext

A validation builder context.

| Improve this Doc View Source

GetContextForMember<TValidated, TValue>(Expression<Func<TValidated, TValue>>, ValidatorBuilderContext)

Gets the validator builder context for validating values of a specified member of a validated object.

Declaration
public ValidatorBuilderContext GetContextForMember<TValidated, TValue>(Expression<Func<TValidated, TValue>> memberAccessor, ValidatorBuilderContext validatorContext)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TValidated, TValue>> memberAccessor

An expression which indicates the member of TValidated to validate.

ValidatorBuilderContext validatorContext

Contextual information relating to how a validator is built.

Returns
Type Description
ValidatorBuilderContext

A context object for building a validator.

Type Parameters
Name Description
TValidated

The type of the primary object under validation.

TValue

The type of the member being validated.

| Improve this Doc View Source

GetContextForValue<TValidated, TValue>(Func<TValidated, TValue>, ValidatorBuilderContext)

Gets the validator builder context for validating values that have been retrieved from a validated object.

Declaration
public ValidatorBuilderContext GetContextForValue<TValidated, TValue>(Func<TValidated, TValue> valueAccessor, ValidatorBuilderContext validatorContext)
Parameters
Type Name Description
System.Func<TValidated, TValue> valueAccessor

An accessor function which gets the value to be validated from a TValidated.

ValidatorBuilderContext validatorContext

Contextual information relating to how a validator is built.

Returns
Type Description
ValidatorBuilderContext

A context object for building a validator.

Type Parameters
Name Description
TValidated

The type of the primary object under validation.

TValue

The type of the retrieved value being validated.

| Improve this Doc View Source

GetPolymorphicContext(ValidatorBuilderContext, Type)

Gets a validator context for polymorphic validation of a derived type.

Declaration
public ValidatorBuilderContext GetPolymorphicContext(ValidatorBuilderContext validatorContext, Type derivedType)
Parameters
Type Name Description
ValidatorBuilderContext validatorContext

Contextual information relating to how a validator is built.

System.Type derivedType

The derived type for which the polymorphic context will be used.

Returns
Type Description
ValidatorBuilderContext

A context object for building a validator.

Implements

IGetsValidatorBuilderContext
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX