Table of Contents

Class MultiRowTypeParsingInfo

Namespace
Rinku.Mapping
Assembly
Rinku.dll

Registers a type that adds values from several rows into one result. Supply how to create the working value, how to add one element, and how to create the final result. Use ForList for lists and ForArray for arrays.

public class MultiRowTypeParsingInfo : TypeParsingInfo, IMultiRowTypeParsingInfo
Inheritance
MultiRowTypeParsingInfo
Implements
Inherited Members
Extension Methods

Constructors

MultiRowTypeParsingInfo(MethodBase, MethodBase?, MethodBase?)

Builds a multi-row info seeding the accumulator with initialState, folding with add (required to determine element type), and finishing with finish (null for identity).

public MultiRowTypeParsingInfo(MethodBase initialState, MethodBase? add, MethodBase? finish)

Parameters

initialState MethodBase
add MethodBase
finish MethodBase

Fields

Add

The method that adds one element to the working value. Its single parameter defines the element type and any return value is ignored.

public readonly MethodBase Add

Field Value

MethodBase

Finish

The construction from the accumulator to the declared value, or null when the accumulator already is the value (a List, or a set filled in place).

public readonly MethodBase? Finish

Field Value

MethodBase

ForArray

Maps an array, folding into a List<element> and finishing with its ToArray. Register it against a specific array type, for example AddOrSet(typeof(Child[]), MultiRowTypeParsingInfo.ForArray).

public static readonly MultiRowTypeParsingInfo ForArray

Field Value

MultiRowTypeParsingInfo

ForList

The built-in List<> mapping, where the accumulator is already the result.

public static readonly MultiRowTypeParsingInfo ForList

Field Value

MultiRowTypeParsingInfo

InitialState

The construction that seeds an empty accumulator, a parameterless constructor or a static factory. The accumulator each row folds into is its declaring type (a constructor) or its return (a factory).

public readonly MethodBase InitialState

Field Value

MethodBase

Methods

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

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

public override 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

ValidateCanUseType(Type)

Throws when this mapping cannot be registered for TargetType.

public override void ValidateCanUseType(Type targetType)

Parameters

targetType Type