Class BuilderValidatedTypeProvider
Default implementation of IGetsValidatedTypeForBuilderType which uses reflection and Linq to determine the builder type's generic type.
Inheritance
Implements
Inherited Members
Namespace: CSF.Validation.ValidatorBuilding
Assembly: CSF.Validation.dll
Syntax
public class BuilderValidatedTypeProvider : IGetsValidatedTypeForBuilderType
Methods
| Improve this Doc View SourceGetValidatedType(Type)
Gets the generic validated type appropriate for the specified builderType
.
Declaration
public Type GetValidatedType(Type builderType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | builderType | A type that indicates a validator builder. |
Returns
Type | Description |
---|---|
System.Type | The System.Type for which the specified builder type validates. |
Remarks
A builder type is one which implements the interface IBuildsValidator<TValidated>. This method gets the value of the generic type parameter used for that interface.
In order to be used with this method, the builderType
must implement
IBuildsValidator<TValidated> for precisely one generic type.
If the builder type implements the interface more than once then this method will be unable to return
a definitive result and will throw an exception.