Table of Contents

Class TypeParsingInfoHelper

Namespace
Rinku.Mapping
Assembly
Rinku.dll

Provides methods to change names, null rules, construction paths, members, and grouping.

public static class TypeParsingInfoHelper
Inheritance
TypeParsingInfoHelper
Inherited Members

Methods

AddMember(TypeParsingInfo, MemberParser)

Adds an existing MemberParser to fill after construction.

public static bool AddMember(this TypeParsingInfo info, MemberParser member)

Parameters

info TypeParsingInfo
member MemberParser

Returns

bool

AddMember(TypeParsingInfo, MemberInfo)

Manually add a member to fill after construction, a public field or writable property, or a setter method (static (instance, value) or instance (value)). The value's ParamInfo is derived the same way discovery derives it.

public static bool AddMember(this TypeParsingInfo info, MemberInfo member)

Parameters

info TypeParsingInfo
member MemberInfo

Returns

bool

AddPossibleConstruction(TypeParsingInfo, MethodCtorInfo)

Adds a configured construction path to the available paths.

public static bool AddPossibleConstruction(this TypeParsingInfo info, MethodCtorInfo mci)

Parameters

info TypeParsingInfo
mci MethodCtorInfo

Returns

bool

AddPossibleConstruction(TypeParsingInfo, MethodBase)

Adds a constructor or factory method to the available construction paths.

public static bool AddPossibleConstruction(this TypeParsingInfo info, MethodBase methodBase)

Parameters

info TypeParsingInfo
methodBase MethodBase

Returns

bool

ClearGroupKey(TypeParsingInfo)

Clears an assigned group boundary so the mapping can use its discovered default, returning false when the info does not expose one.

public static bool ClearGroupKey(this TypeParsingInfo info)

Parameters

info TypeParsingInfo

Returns

bool

ClearGroupKey<T>()

Clears the assigned type-level group boundary of T so its attribute default or inference applies.

public static void ClearGroupKey<T>()

Type Parameters

T

GetConstruction(TypeParsingInfo, MethodBase)

Gets the exact constructor or factory method registered in the type info.

public static MethodCtorInfo GetConstruction(this TypeParsingInfo info, MethodBase construction)

Parameters

info TypeParsingInfo
construction MethodBase

Returns

MethodCtorInfo

GetConstruction(TypeParsingInfo, params Type[])

Gets the construction path with the specified parameter types.

public static MethodCtorInfo GetConstruction(this TypeParsingInfo info, params Type[] constructionParameters)

Parameters

info TypeParsingInfo
constructionParameters Type[]

Returns

MethodCtorInfo

GetConstruction<T>(MethodBase)

Gets the exact registered construction path of T.

public static MethodCtorInfo GetConstruction<T>(MethodBase construction)

Parameters

construction MethodBase

Returns

MethodCtorInfo

Type Parameters

T

GetConstruction<T>(params Type[])

Gets a construction path of T by parameter types.

public static MethodCtorInfo GetConstruction<T>(params Type[] constructionParameters)

Parameters

constructionParameters Type[]

Returns

MethodCtorInfo

Type Parameters

T

SetAbortOnNull(TypeParsingInfo, Func<ParamInfo, bool?>)

Updates whether each slot stops its containing object on null. The modifier receives each slot and decides whether to change it.

public static bool SetAbortOnNull(this TypeParsingInfo info, Func<ParamInfo, bool?> modifier)

Parameters

info TypeParsingInfo

The type mapping to change.

modifier Func<ParamInfo, bool?>

Returns the new setting for each slot. Return null to keep it.

Returns

bool

SetAbortOnNull(TypeParsingInfo, string, bool)

Configures the null-value response behavior for the slots matching defaultName. The simplest form of SetAbortOnNull(TypeParsingInfo, Func<ParamInfo, bool?>).

public static bool SetAbortOnNull(this TypeParsingInfo info, string defaultName, bool abortOnNull)

Parameters

info TypeParsingInfo

The type mapping to change.

defaultName string

The parameter name in C#.

abortOnNull bool

Whether a database NULL should collapse the containing value.

Returns

bool

SetGroupKey(TypeParsingInfo, IGroupingRule)

Replaces the group boundary of an editable info, returning false when the info does not expose one.

public static bool SetGroupKey(this TypeParsingInfo info, IGroupingRule rule)

Parameters

info TypeParsingInfo
rule IGroupingRule

Returns

bool

SetGroupKeyColumns<T>(params string[])

Sets the group boundary of T to an equality key over the named columns, each read as whatever type its column carries, no member required.

public static void SetGroupKeyColumns<T>(params string[] columns)

Parameters

columns string[]

Type Parameters

T

SetGroupKeyMethod<T>(string)

Sets the group boundary of T to the boundary a marked static method computes.

public static void SetGroupKeyMethod<T>(string method)

Parameters

method string

Type Parameters

T

SetGroupKey<T>(IGroupingRule)

Sets the type-level group boundary of T to rule.

public static void SetGroupKey<T>(IGroupingRule rule)

Parameters

rule IGroupingRule

Type Parameters

T

SetGroupKey<T>(params string[])

Adds a type-level equality option over named members. An unmatched schema continues to inference.

public static void SetGroupKey<T>(params string[] members)

Parameters

members string[]

Type Parameters

T

UpdateAltName(TypeParsingInfo, Func<INameComparer, INameComparer?>)

Adjusts how the type's members are matched to column names, when the info supports it.

public static bool UpdateAltName(this TypeParsingInfo info, Func<INameComparer, INameComparer?> modifier)

Parameters

info TypeParsingInfo

The type mapping to change.

modifier Func<INameComparer, INameComparer>

Returns the new name rule for each slot. Return null to keep it.

Returns

bool

UpdateNullColHandler(TypeParsingInfo, Func<ParamInfo, INullColHandler?>)

Updates the null response of each slot with a callback. The modifier receives each slot and decides whether to change it.

public static bool UpdateNullColHandler(this TypeParsingInfo info, Func<ParamInfo, INullColHandler?> modifier)

Parameters

info TypeParsingInfo

The type mapping to change.

modifier Func<ParamInfo, INullColHandler>

Returns the new null rule for each slot. Return null to keep it.

Returns

bool

UpdateNullColHandler(TypeParsingInfo, string, INullColHandler)

Sets the null-value response behavior for the slots matching defaultName. The simplest form of UpdateNullColHandler(TypeParsingInfo, Func<ParamInfo, INullColHandler?>).

public static bool UpdateNullColHandler(this TypeParsingInfo info, string defaultName, INullColHandler handler)

Parameters

info TypeParsingInfo

The type mapping to change.

defaultName string

The parameter name in C#.

handler INullColHandler

The null rule for matching slots.

Returns

bool