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
TUnderlying .NET type.
TDataRecordDB data record type.
TParameterDB 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
dataTypeISqlDataTypeUnderlying DB data type.
defaultValueTSpecifies the default value for this type.
outputMappingExpression<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
parameterTParameterParameter to update.
isNullableboolSpecifies whether or not the
parametershould be marked as nullable.