Table of Contents

Class ConvertedDbParamInfo<T>

Namespace
Rinku.Querying
Assembly
Rinku.dll

Base settings for a parameter whose value must be converted before it is sent to the database.

public abstract class ConvertedDbParamInfo<T> : DbParamInfo

Type Parameters

T

The CLR type accepted by the parameter.

Inheritance
ConvertedDbParamInfo<T>
Inherited Members
Extension Methods

Remarks

Override ConvertValue(T) for the conversion. Override ConfigureParameter(IDbDataParameter) when the created parameter needs a type, size, precision, scale, or provider-specific setting. Inherit directly from DbParamInfo when the parameter needs different reuse behavior.

Constructors

ConvertedDbParamInfo()

Creates a cached conversion strategy.

protected ConvertedDbParamInfo()

Methods

ConfigureParameter(IDbDataParameter)

Configures a newly created parameter after its name and value are set.

protected virtual void ConfigureParameter(IDbDataParameter parameter)

Parameters

parameter IDbDataParameter

ConvertValue(T)

Converts one CLR value to the value stored in the database parameter.

protected abstract object? ConvertValue(T value)

Parameters

value T

Returns

object

Remove(IDbCommand, object)

Drops the parameter reference from the command.

public override sealed 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 sealed bool SaveUse(string paramName, IDbCommand cmd, ref object value)

Parameters

paramName string
cmd IDbCommand
value object

Returns

bool

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 sealed 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 sealed 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 sealed bool Use(string paramName, IDbCommand cmd, object value)

Parameters

paramName string
cmd IDbCommand
value object

Returns

bool