Table of Contents

Class ParamInfo

Namespace
Rinku.Mapping
Assembly
Rinku.dll

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

Type Type
NullColHandler INullColHandler
NameComparer INameComparer

Fields

NoType

Marks a temporary slot whose type will be supplied later.

public static readonly Type NoType

Field Value

Type

Type

The type of the parameter or member.

public Type Type

Field Value

Type

Properties

ComparerFactory

Gets or sets the callback that chooses a name comparer.

public static NameComparerFactory ComparerFactory { get; set; }

Property Value

NameComparerFactory

NameComparer

The logic used to match column names against this member's identifiers.

public INameComparer NameComparer { get; set; }

Property Value

INameComparer

NullColHandler

The current strategy for handling database NULL values.

public INullColHandler NullColHandler { get; set; }

Property Value

INullColHandler

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

Func<ParamInfo, ParamInfo>

RequireExactType

Gets or sets whether the column type must be an exact match.

public virtual bool RequireExactType { get; set; }

Property Value

bool

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

type Type
name string
attributes object[]
param object

Returns

ParamInfo

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

type Type
name string
altNames string[]
attributes object[]
param object
nameComparerMakers List<INameComparerMaker>

Returns

INameComparer

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

mod ColModifier
nbClaims int

FallbackTryGetParser(Type)

Provides a value when no result column matches this slot.

public virtual DbItemPlan? FallbackTryGetParser(Type type)

Parameters

type Type

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

type Type
name string
attributes object[]
param object

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

abortOnNull bool

TryNew(FieldInfo)

Creates a matcher for a class field if the type is usable.

public static ParamInfo? TryNew(FieldInfo f)

Parameters

f FieldInfo

Returns

ParamInfo

TryNew(ParameterInfo)

Creates a matcher for a constructor or method parameter if the type is usable.

public static ParamInfo? TryNew(ParameterInfo p)

Parameters

p ParameterInfo

Returns

ParamInfo

TryNew(PropertyInfo)

Creates a matcher for a class property if the type is usable.

public static ParamInfo? TryNew(PropertyInfo p)

Parameters

p PropertyInfo

Returns

ParamInfo

UpdateAltName(Func<INameComparer, INameComparer?>)

Adds an alternative name to the existing NameComparer.

public void UpdateAltName(Func<INameComparer, INameComparer?> modifier)

Parameters

modifier Func<INameComparer, INameComparer>

UpdateColModifier(ref ColModifier)

Applies this slot's reading order rules.

public virtual void UpdateColModifier(ref ColModifier mod)

Parameters

mod ColModifier

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

modifier IColModifier

Returns

ParamInfo