Table of Contents

Class SqlColumnTypeDefinition<T, TDataRecord, TParameter>

Namespace
LfrlAnvil.Sql
Assembly
LfrlAnvil.Sql.Core.dll

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>>)

protected SqlColumnTypeDefinition(ISqlDataType dataType, T defaultValue, Expression<Func<TDataRecord, int, T>> outputMapping)

Parameters

dataType ISqlDataType

Underlying DB data type.

defaultValue T

Specifies 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 TParameter

Parameter to update.

isNullable bool

Specifies whether or not the parameter should be marked as nullable.