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
parameter
IDbDataParameterParameter to update.
isNullable
boolSpecifies whether or not the
parameter
should 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
value
objectValue to convert.
Returns
- string
DB literal from
value
or 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
value
objectValue to convert.
Returns
- object
Converted
value
or null when it is not of the specified RuntimeType.