Class TypeParsingInfo
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
Methods
AddOrSet(Type, TypeParsingInfo)
Registers typeParsingInfo for type and replaces an existing registration.
public static void AddOrSet(Type type, TypeParsingInfo typeParsingInfo)
Parameters
typeTypetypeParsingInfoTypeParsingInfo
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
typeParsingInfoTypeParsingInfosaveAsGenericDefinitionWhenGenericbool
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
typeType
Returns
Get(Type)
Gets the registered mapping for a type without creating one.
public static TypeParsingInfo? Get(Type type)
Parameters
typeType
Returns
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
typeTypetoUseIfNotPresentTypeParsingInfosaveAsGenericDefinitionWhenGenericbool
Returns
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
toUseIfNotPresentTypeParsingInfosaveAsGenericDefinitionWhenGenericbool
Returns
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
typeType
Returns
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
typeTypecallerFlagsMethodCtorInfo.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
typeTypetypeInfoTypeParsingInfo
Returns
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
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
TryRemove(Type, out TypeParsingInfo)
Removes the mapping registered under the exact type key.
public static bool TryRemove(Type type, out TypeParsingInfo typeParsingInfo)
Parameters
typeTypetypeParsingInfoTypeParsingInfo
Returns
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
TargetTypeType