Class ParamInfo
Describes how one constructor parameter, property, or field matches and reads a column. Change its name and null rules when the defaults do not match the database.
public class ParamInfo
- Inheritance
-
ParamInfo
- Derived
- Inherited Members
- Extension Methods
Constructors
ParamInfo(Type, INullColHandler, INameComparer)
Describes how one constructor parameter, property, or field matches and reads a column. Change its name and null rules when the defaults do not match the database.
public ParamInfo(Type Type, INullColHandler NullColHandler, INameComparer NameComparer)
Parameters
TypeTypeNullColHandlerINullColHandlerNameComparerINameComparer
Fields
NoType
Marks a temporary slot whose type will be supplied later.
public static readonly Type NoType
Field Value
Type
The type of the parameter or member.
public Type Type
Field Value
Properties
ComparerFactory
Gets or sets the callback that chooses a name comparer.
public static NameComparerFactory ComparerFactory { get; set; }
Property Value
NameComparer
The logic used to match column names against this member's identifiers.
public INameComparer NameComparer { get; set; }
Property Value
NullColHandler
The current strategy for handling database NULL values.
public INullColHandler NullColHandler { get; set; }
Property Value
RegistrationInitializer
Gets or sets the callback applied to every slot created by Create(Type, string?, object[], object?). Set it during application startup to apply a naming or null rule across the application. Return the received slot after changing it or return a replacement. Slots created directly do not call it.
public static Func<ParamInfo, ParamInfo>? RegistrationInitializer { get; set; }
Property Value
RequireExactType
Gets or sets whether the column type must be an exact match.
public virtual bool RequireExactType { get; set; }
Property Value
Methods
Create(Type, string?, object[], object?)
Creates the slot rules for a member or parameter and applies its attributes.
public static ParamInfo Create(Type type, string? name, object[] attributes, object? param = null)
Parameters
Returns
Remarks
A custom IParamInfoMaker takes control before the standard attributes are applied.
DispatchComparer(Type, string?, string[], object[], object?, List<INameComparerMaker>)
Creates a name comparer from a name, alternative names, and naming attributes.
public static INameComparer DispatchComparer(Type type, string? name, string[] altNames, object[] attributes, object? param, List<INameComparerMaker> nameComparerMakers)
Parameters
typeTypenamestringaltNamesstring[]attributesobject[]paramobjectnameComparerMakersList<INameComparerMaker>
Returns
EnterSubtree(ref ColModifier, int)
Applies this slot's reading order rules to a nested value.
public virtual void EnterSubtree(ref ColModifier mod, int nbClaims)
Parameters
modColModifiernbClaimsint
FallbackTryGetParser(Type)
Provides a value when no result column matches this slot.
public virtual DbItemPlan? FallbackTryGetParser(Type type)
Parameters
typeType
Returns
- DbItemPlan
The fallback plan or null when the slot is required.
GetDeclaredNullColHandler(Type, string?, object[], object?)
Resolves the nullability that a set of attributes declares, a custom INullColHandlerMaker, NotNullAttribute, MaybeNullAttribute, composed with AbortOnNullAttribute. This is the resolution Create(Type, string?, object[], object?) uses before falling back to the type's own nullability.
public static INullColHandler? GetDeclaredNullColHandler(Type type, string? name, object[] attributes, object? param = null)
Parameters
Returns
- INullColHandler
The declared handler, or null when nothing is declared.
SetAbortOnNull(bool)
Sets whether a null value stops construction of the containing object.
public void SetAbortOnNull(bool abortOnNull)
Parameters
abortOnNullbool
TryNew(FieldInfo)
Creates a matcher for a class field if the type is usable.
public static ParamInfo? TryNew(FieldInfo f)
Parameters
Returns
TryNew(ParameterInfo)
Creates a matcher for a constructor or method parameter if the type is usable.
public static ParamInfo? TryNew(ParameterInfo p)
Parameters
Returns
TryNew(PropertyInfo)
Creates a matcher for a class property if the type is usable.
public static ParamInfo? TryNew(PropertyInfo p)
Parameters
Returns
UpdateAltName(Func<INameComparer, INameComparer?>)
Adds an alternative name to the existing NameComparer.
public void UpdateAltName(Func<INameComparer, INameComparer?> modifier)
Parameters
modifierFunc<INameComparer, INameComparer>
UpdateColModifier(ref ColModifier)
Applies this slot's reading order rules.
public virtual void UpdateColModifier(ref ColModifier mod)
Parameters
modColModifier
WithColModifier(IColModifier)
Returns a copy that applies modifier while keeping this slot's name, null, type,
exact type, and missing column rules.
public ParamInfo WithColModifier(IColModifier modifier)
Parameters
modifierIColModifier