Table of Contents

Class SizedDbParamCache

Namespace
Rinku.Querying.Defaults
Assembly
Rinku.dll

Provides type and size settings for text, binary, and XML parameters. Sizes are rounded to shared limits to reduce database query plan fragmentation.

public class SizedDbParamCache : DbParamInfo
Inheritance
SizedDbParamCache
Inherited Members
Extension Methods

Fields

Size

The size that will be used to create the parameter.

public readonly int Size

Field Value

int

Type

The DbType that will be used to create the parameter.

public readonly DbType Type

Field Value

DbType

Methods

Get(DbType, int)

Gets parameter settings for the supplied type and requested size.

public static SizedDbParamCache Get(DbType type, int size)

Parameters

type DbType
size int

Returns

SizedDbParamCache

Remove(IDbCommand, object?)

Drops the parameter reference from the command.

public override void Remove(IDbCommand cmd, object? currentValue)

Parameters

cmd IDbCommand
currentValue object

SaveUse(string, IDbCommand, ref object)

Binds a value and hands back the parameter reference in value, so a later Update(IDbCommand, ref object?, object?) can change it without a lookup.

public override bool SaveUse(string paramName, IDbCommand cmd, ref object value)

Parameters

paramName string
cmd IDbCommand
value object

Returns

bool

TryGet(DbType, int, out SizedDbParamCache)

Try to retrieve the singleton instance corresponding to the parameters or creates it

public static bool TryGet(DbType type, int size, out SizedDbParamCache cache)

Parameters

type DbType
size int
cache SizedDbParamCache

Returns

bool

false when the type is not a DbType that contains a size.

Update(IDbCommand, ref object?, object?)

Changes an already-bound parameter's value. currentValue is the parameter reference a previous SaveUse(string, IDbCommand, ref object) handed back.

public override bool Update(IDbCommand cmd, ref object? currentValue, object? newValue)

Parameters

cmd IDbCommand
currentValue object
newValue object

Returns

bool

Use(string, DbCommand, object)

Binds a value to the command for a single execution.

public override bool Use(string paramName, DbCommand cmd, object value)

Parameters

paramName string
cmd DbCommand
value object

Returns

bool

Use(string, IDbCommand, object)

Binds a value for a single run, without keeping a reference for reuse.

public override bool Use(string paramName, IDbCommand cmd, object value)

Parameters

paramName string
cmd IDbCommand
value object

Returns

bool