Interface ISqlColumnTypeDefinition
Represents a type-erased definition of a column type.
public interface ISqlColumnTypeDefinition
- Extension Methods
Properties
DataType
Underlying DB data type.
ISqlDataType DataType { get; }
Property Value
DefaultValue
Specifies the default value for this type.
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.
LambdaExpression OutputMapping { get; }
Property Value
RuntimeType
Underlying .NET type.
Type RuntimeType { get; }
Property Value
Methods
SetParameterInfo(IDbDataParameter, bool)
Updates information of the provided parameter
with this type's definition.
void SetParameterInfo(IDbDataParameter parameter, bool isNullable)
Parameters
parameter
IDbDataParameterParameter to update.
isNullable
boolSpecifies whether or not the
parameter
should be marked as nullable.
TryToDbLiteral(object)
Attempts to create an inline DB literal representation of the provided value
.
[Pure]
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]
object? TryToParameterValue(object value)
Parameters
value
objectValue to convert.
Returns
- object
Converted
value
or null when it is not of the specified RuntimeType.