Table of Contents

Class ReusingBaseTypeParserMaker

Namespace
Rinku.Mapping.Defaults
Assembly
Rinku.dll

A base class for a result type that wraps one element type. Derive from this class for wrappers such as Result<T>. Implement ITypeParserMaker directly for other result types.

public class ReusingBaseTypeParserMaker : ITypeParserMaker
Inheritance
ReusingBaseTypeParserMaker
Implements
Derived
Inherited Members
Extension Methods

Constructors

ReusingBaseTypeParserMaker(Type[], GetParserType, GetParserType?, Func<Type, Type>?)

A base class for a result type that wraps one element type. Derive from this class for wrappers such as Result<T>. Implement ITypeParserMaker directly for other result types.

public ReusingBaseTypeParserMaker(Type[] acceptedGenericDefinitions, GetParserType GetParserType, GetParserType? GetParserTypeWhenSimple = null, Func<Type, Type>? GetElementType = null)

Parameters

acceptedGenericDefinitions Type[]
GetParserType GetParserType
GetParserTypeWhenSimple GetParserType
GetElementType Func<Type, Type>

Methods

CanHandle<T>()

Whether this maker claims T.

public bool CanHandle<T>()

Returns

bool

Type Parameters

T

DeclaredElementNullability(Type)

The element nullability a wrapper definition declares on its value parameter, resolved by GetDeclaredNullColHandler(Type, string?, object[], object?) (e.g. the MaybeNullAttribute on OptionalNullable<T>). null when nothing is declared, the element's own type decides.

public static INullColHandler? DeclaredElementNullability(Type definition)

Parameters

definition Type

Returns

INullColHandler

TryMakeParser<T>(INullColHandler, ColumnInfo[], out ITypeParser<T>)

Builds the parser for T over the given columns, or returns false to decline.

public bool TryMakeParser<T>(INullColHandler nullColHandler, ColumnInfo[] cols, out ITypeParser<T> parser)

Parameters

nullColHandler INullColHandler
cols ColumnInfo[]
parser ITypeParser<T>

Returns

bool

Type Parameters

T

Remarks

nullColHandler is the requested root nullability. It is GetDefaultNullColHandler<T>() (the type's own nullability) unless a caller replaced it. The method must accept any INullColHandler.