Class SqlColumnTypeDefinition
Represents a type-erased definition of a column type.
public abstract class SqlColumnTypeDefinition : ISqlColumnTypeDefinition
- Inheritance
-
SqlColumnTypeDefinition
- Implements
- Derived
- Inherited Members
- Extension Methods
Properties
DataType
Underlying DB data type.
public ISqlDataType DataType { get; }
Property Value
DefaultValue
Specifies the default value for this type.
public SqlLiteralNode DefaultValue { get; }
Property Value
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 LambdaExpression OutputMapping { get; }
Property Value
RuntimeType
Underlying .NET type.
public abstract Type RuntimeType { get; }
Property Value
Methods
SetParameterInfo(IDbDataParameter, bool)
Updates information of the provided parameter with this type's definition.
public abstract void SetParameterInfo(IDbDataParameter parameter, bool isNullable)
Parameters
parameterIDbDataParameterParameter to update.
isNullableboolSpecifies whether or not the
parametershould be marked as nullable.
ToString()
Returns a string representation of this SqlColumnTypeDefinition instance.
[Pure]
public override sealed string ToString()
Returns
- string
String representation.
TryToDbLiteral(object)
Attempts to create an inline DB literal representation of the provided value.
[Pure]
public abstract string? TryToDbLiteral(object value)
Parameters
valueobjectValue to convert.
Returns
- string
DB literal from
valueor null when it is not of the specified RuntimeType.
TryToParameterValue(object)
Attempts to create an object from the provided value
that can be used to set DB parameter's Value with.
[Pure]
public abstract object? TryToParameterValue(object value)
Parameters
valueobjectValue to convert.
Returns
- object
Converted
valueor null when it is not of the specified RuntimeType.