Table of Contents

Class TypeParsingInfo

Namespace
Rinku.Mapping
Assembly
Rinku.dll

Controls how one type is created from result columns. Register or change one to choose construction paths, members, names, null rules, and grouping. An open generic registration applies when no exact registration exists.

public abstract class TypeParsingInfo
Inheritance
TypeParsingInfo
Derived
Inherited Members
Extension Methods

Properties

RegistrationInitializer

Changes every mapping generated by Rinku. Return the received mapping after changing it or return a replacement. Set it during application startup. Mappings passed directly to registration methods do not use this callback.

public static Func<Type, TypeParsingInfo, TypeParsingInfo>? RegistrationInitializer { get; set; }

Property Value

Func<Type, TypeParsingInfo, TypeParsingInfo>

Methods

AddOrSet(Type, TypeParsingInfo)

Registers typeParsingInfo for type and replaces an existing registration.

public static void AddOrSet(Type type, TypeParsingInfo typeParsingInfo)

Parameters

type Type
typeParsingInfo TypeParsingInfo

Remarks

This affects parsers created later. Existing parsers are unchanged.

AddOrSet<T>(TypeParsingInfo, bool)

Registers typeParsingInfo for type and replaces an existing registration.

public static void AddOrSet<T>(TypeParsingInfo typeParsingInfo, bool saveAsGenericDefinitionWhenGeneric = true)

Parameters

typeParsingInfo TypeParsingInfo
saveAsGenericDefinitionWhenGeneric bool

Type Parameters

T

Remarks

This affects parsers created later. Existing parsers are unchanged.

ForceGet(Type)

Gets the mapping for a type and creates the default when none is registered.

public static TypeParsingInfo ForceGet(Type type)

Parameters

type Type

Returns

TypeParsingInfo

Get(Type)

Gets the registered mapping for a type without creating one.

public static TypeParsingInfo? Get(Type type)

Parameters

type Type

Returns

TypeParsingInfo

Remarks

Closed generic types use their open generic registration when no exact registration exists.

GetOrAdd(Type, TypeParsingInfo?, bool)

Gets the mapping for a type or registers the supplied or default mapping.

public static TypeParsingInfo GetOrAdd(Type type, TypeParsingInfo? toUseIfNotPresent = null, bool saveAsGenericDefinitionWhenGeneric = true)

Parameters

type Type
toUseIfNotPresent TypeParsingInfo
saveAsGenericDefinitionWhenGeneric bool

Returns

TypeParsingInfo

GetOrAdd<T>(TypeParsingInfo?, bool)

Gets the mapping for T or registers the supplied or default mapping.

public static TypeParsingInfo GetOrAdd<T>(TypeParsingInfo? toUseIfNotPresent = null, bool saveAsGenericDefinitionWhenGeneric = true)

Parameters

toUseIfNotPresent TypeParsingInfo
saveAsGenericDefinitionWhenGeneric bool

Returns

TypeParsingInfo

Type Parameters

T

IsUsableType(Type)

Returns whether the type has a built in mapping, a registration, or implements IDbReadable.

public static bool IsUsableType(Type type)

Parameters

type Type

Returns

bool

RegisterGenericArguments(Type, AdditionalFlags)

Registers the direct generic arguments of type when the caller flags request it.

protected static void RegisterGenericArguments(Type type, MethodCtorInfo.AdditionalFlags callerFlags)

Parameters

type Type
callerFlags MethodCtorInfo.AdditionalFlags

TryGetInfo(Type, out TypeParsingInfo)

Gets a type mapping when the type is already registered, scalar, an array, or marked with IDbReadable.

public static bool TryGetInfo(Type type, out TypeParsingInfo typeInfo)

Parameters

type Type
typeInfo TypeParsingInfo

Returns

bool

Remarks

Closed generic types use their open generic registration when no exact registration exists.

TryGetParser(Type, RecursiveInfo, ParamInfo, ColumnInfo[], ColModifier, ref ColumnUsage, AdditionalFlags)

Tries to create a read plan for the requested type and result columns.

public abstract DbItemPlan? TryGetParser(Type currentClosedType, RecursiveInfo previousUsages, ParamInfo paramInfo, ColumnInfo[] columns, ColModifier colModifier, ref ColumnUsage colUsage, MethodCtorInfo.AdditionalFlags callerFlags = (MethodCtorInfo.AdditionalFlags)0)

Parameters

currentClosedType Type

The closed type being parsed.

previousUsages RecursiveInfo

The parent types already used by this path.

paramInfo ParamInfo

The slot rules for the value being parsed.

columns ColumnInfo[]

The result columns available to the parser.

colModifier ColModifier

The current column matching settings.

colUsage ColumnUsage

The columns already consumed by the current path.

callerFlags MethodCtorInfo.AdditionalFlags

Flags from the construction path that requested this child.

Returns

DbItemPlan

TryRemove(Type, out TypeParsingInfo)

Removes the mapping registered under the exact type key.

public static bool TryRemove(Type type, out TypeParsingInfo typeParsingInfo)

Parameters

type Type
typeParsingInfo TypeParsingInfo

Returns

bool

Remarks

This affects parsers created later. Existing parsers and references to the removed mapping are unchanged.

ValidateCanUseType(Type)

Throws when this mapping cannot be registered for TargetType.

public abstract void ValidateCanUseType(Type TargetType)

Parameters

TargetType Type