Class DbParamInfo
How one parameter is bound onto a command, add, set, update, remove. Subclass it to take over binding for a parameter, for a provider quirk or a custom type the default path handles wrong.
public abstract class DbParamInfo
- Inheritance
-
DbParamInfo
- Derived
- Inherited Members
- Extension Methods
Constructors
DbParamInfo(bool, bool)
How one parameter is bound onto a command, add, set, update, remove. Subclass it to take over binding for a parameter, for a provider quirk or a custom type the default path handles wrong.
protected DbParamInfo(bool IsCached, bool HasDefaultSet = false)
Parameters
Fields
HasDefaultSet
Whether this strategy can materialize a parameter when no value was supplied.
public readonly bool HasDefaultSet
Field Value
IsCached
Whether this strategy is settled. While false, the command may still replace it with a more exact one learned from the provider.
public bool IsCached
Field Value
Methods
Remove(IDbCommand, object)
Drops the parameter reference from the command.
public abstract void Remove(IDbCommand cmd, object currentValue)
Parameters
cmdIDbCommandcurrentValueobject
RemoveSingle(string, DbCommand)
Removes a parameter by name from the command collection.
public static bool RemoveSingle(string paramName, DbCommand cmd)
Parameters
Returns
RemoveSingle(string, IDbCommand)
Drops a parameter from the command by name.
public static bool RemoveSingle(string paramName, IDbCommand cmd)
Parameters
paramNamestringcmdIDbCommand
Returns
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 abstract bool SaveUse(string paramName, IDbCommand cmd, ref object value)
Parameters
paramNamestringcmdIDbCommandvalueobject
Returns
SetDefault(string, IDbCommand)
Materializes the parameter's default state and returns the live state it created.
public virtual object? SetDefault(string paramName, IDbCommand cmd)
Parameters
paramNamestringcmdIDbCommand
Returns
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 abstract bool Update(IDbCommand cmd, ref object? currentValue, object? newValue)
Parameters
cmdIDbCommandcurrentValueobjectnewValueobject
Returns
Use(string, DbCommand, object)
Binds a value to the command for a single execution.
public abstract bool Use(string paramName, DbCommand cmd, object value)
Parameters
Returns
Use(string, IDbCommand, object)
Binds a value for a single run, without keeping a reference for reuse.
public abstract bool Use(string paramName, IDbCommand cmd, object value)
Parameters
paramNamestringcmdIDbCommandvalueobject