Class MultiRowTypeParsingInfo
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
initialStateMethodBaseaddMethodBasefinishMethodBase
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
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
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
ForList
The built-in List<> mapping, where the accumulator is already the result.
public static readonly MultiRowTypeParsingInfo ForList
Field Value
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
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
currentClosedTypeTypeThe closed type being parsed.
previousUsagesRecursiveInfoThe parent types already used by this path.
paramInfoParamInfoThe slot rules for the value being parsed.
columnsColumnInfo[]The result columns available to the parser.
colModifierColModifierThe current column matching settings.
colUsageColumnUsageThe columns already consumed by the current path.
callerFlagsMethodCtorInfo.AdditionalFlagsFlags from the construction path that requested this child.
Returns
ValidateCanUseType(Type)
Throws when this mapping cannot be registered for TargetType.
public override void ValidateCanUseType(Type targetType)
Parameters
targetTypeType