Class TypeParsingInfoHelper
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
infoTypeParsingInfomemberMemberParser
Returns
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
infoTypeParsingInfomemberMemberInfo
Returns
AddPossibleConstruction(TypeParsingInfo, MethodCtorInfo)
Adds a configured construction path to the available paths.
public static bool AddPossibleConstruction(this TypeParsingInfo info, MethodCtorInfo mci)
Parameters
infoTypeParsingInfomciMethodCtorInfo
Returns
AddPossibleConstruction(TypeParsingInfo, MethodBase)
Adds a constructor or factory method to the available construction paths.
public static bool AddPossibleConstruction(this TypeParsingInfo info, MethodBase methodBase)
Parameters
infoTypeParsingInfomethodBaseMethodBase
Returns
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
infoTypeParsingInfo
Returns
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
infoTypeParsingInfoconstructionMethodBase
Returns
GetConstruction(TypeParsingInfo, params Type[])
Gets the construction path with the specified parameter types.
public static MethodCtorInfo GetConstruction(this TypeParsingInfo info, params Type[] constructionParameters)
Parameters
infoTypeParsingInfoconstructionParametersType[]
Returns
GetConstruction<T>(MethodBase)
Gets the exact registered construction path of T.
public static MethodCtorInfo GetConstruction<T>(MethodBase construction)
Parameters
constructionMethodBase
Returns
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
constructionParametersType[]
Returns
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
infoTypeParsingInfoThe type mapping to change.
modifierFunc<ParamInfo, bool?>Returns the new setting for each slot. Return null to keep it.
Returns
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
infoTypeParsingInfoThe type mapping to change.
defaultNamestringThe parameter name in C#.
abortOnNullboolWhether a database
NULLshould collapse the containing value.
Returns
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
infoTypeParsingInforuleIGroupingRule
Returns
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
columnsstring[]
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
methodstring
Type Parameters
T
SetGroupKey<T>(IGroupingRule)
Sets the type-level group boundary of T to rule.
public static void SetGroupKey<T>(IGroupingRule rule)
Parameters
ruleIGroupingRule
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
membersstring[]
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
infoTypeParsingInfoThe type mapping to change.
modifierFunc<INameComparer, INameComparer>Returns the new name rule for each slot. Return null to keep it.
Returns
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
infoTypeParsingInfoThe type mapping to change.
modifierFunc<ParamInfo, INullColHandler>Returns the new null rule for each slot. Return null to keep it.
Returns
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
infoTypeParsingInfoThe type mapping to change.
defaultNamestringThe parameter name in C#.
handlerINullColHandlerThe null rule for matching slots.