Class SqlColumnTypeDefinition<T, TDataRecord, TParameter>
Represents a generic definition of a column type.
public abstract class SqlColumnTypeDefinition<T, TDataRecord, TParameter> : SqlColumnTypeDefinition<T>, ISqlColumnTypeDefinition<T>, ISqlColumnTypeDefinition where T : notnull where TDataRecord : IDataRecord where TParameter : IDbDataParameter
Type Parameters
T
Underlying .NET type.
TDataRecord
DB data record type.
TParameter
DB parameter type.
- Inheritance
-
SqlColumnTypeDefinition<T, TDataRecord, TParameter>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
SqlColumnTypeDefinition(ISqlDataType, T, Expression<Func<TDataRecord, int, T>>)
Creates a new SqlColumnTypeDefinition<T, TDataRecord, TParameter> instance.
protected SqlColumnTypeDefinition(ISqlDataType dataType, T defaultValue, Expression<Func<TDataRecord, int, T>> outputMapping)
Parameters
dataType
ISqlDataTypeUnderlying DB data type.
defaultValue
TSpecifies the default value for this type.
outputMapping
Expression<Func<TDataRecord, int, T>>Specifies the mapping of values read by IDataReader to objects of the specified RuntimeType.
Properties
OutputMapping
Specifies the mapping of values read by IDataReader to objects of the specified RuntimeType. This LambdaExpression should have two parameters, where the first represents an IDataReader instance and the second represents an ordinal of the field from which to read the value.
public Expression<Func<TDataRecord, int, T>> OutputMapping { get; }
Property Value
- Expression<Func<TDataRecord, int, T>>
Methods
SetParameterInfo(TParameter, bool)
Updates information of the provided parameter
with this type's definition.
public virtual void SetParameterInfo(TParameter parameter, bool isNullable)
Parameters
parameter
TParameterParameter to update.
isNullable
boolSpecifies whether or not the
parameter
should be marked as nullable.