Table of Contents

Struct DefaultParamCache

Namespace
Rinku.Querying.Defaults
Assembly
Rinku.dll

Reads parameter metadata off a live IDbCommand as-is, the fallback the command uses to learn its bindings when no provider-specific reader is registered.

public struct DefaultParamCache : IDbParamInfoGetter
Implements
Inherited Members
Extension Methods

Constructors

DefaultParamCache(IDbCommand)

Reads parameter metadata off a live IDbCommand as-is, the fallback the command uses to learn its bindings when no provider-specific reader is registered.

public DefaultParamCache(IDbCommand cmd)

Parameters

cmd IDbCommand

Fields

Command

The command containing the parameters

public IDbCommand Command

Field Value

IDbCommand

Methods

EnumerateParameters()

The command's parameters, as name and position pairs, for learning them all in one pass.

public readonly IEnumerable<KeyValuePair<string, int>> EnumerateParameters()

Returns

IEnumerable<KeyValuePair<string, int>>

MakeDeclaredInfo(IDbDataParameter, bool)

How a parameter binds when its metadata was declared rather than inferred, which is what the database hands back for a stored procedure's parameters.

public static DbParamInfo MakeDeclaredInfo(IDbDataParameter p, bool inputOutputHasDefault = true)

Parameters

p IDbDataParameter

A parameter carrying the metadata that was declared for it.

inputOutputHasDefault bool

Whether a discovered input/output parameter may be omitted.

Returns

DbParamInfo

Remarks

A declaration is exact, so the size, or the precision and scale, are kept as stated instead of being widened the way MakeInfo(IDbDataParameter) widens a guess, and a direction other than input is carried so an output reaches the caller without being pinned by hand.

MakeInfo(IDbDataParameter)

public static DbParamInfo MakeInfo(IDbDataParameter p)

Parameters

p IDbDataParameter

Returns

DbParamInfo

Remarks

This reads what a provider settled on for a value it was handed, which is a guess at a shape rather than a statement of one, so the size is widened to the bucket above it and one plan serves every value of a similar length. MakeDeclaredInfo(IDbDataParameter, bool) is the counterpart for metadata that was declared rather than inferred.

MakeInfoAt(int)

The binding metadata for the parameter at position i.

public readonly DbParamInfo MakeInfoAt(int i)

Parameters

i int

Returns

DbParamInfo

TryGetInfo(string, out DbParamInfo)

Attempts to resolve a DbParamInfo for a specific parameter name by inspecting the current command's parameter collection.

public readonly bool TryGetInfo(string paramName, out DbParamInfo info)

Parameters

paramName string
info DbParamInfo

Returns

bool