Table of Contents

Class SqlColumnTypeDefinition<T>

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

Represents a generic definition of a column type.

public abstract class SqlColumnTypeDefinition<T> : SqlColumnTypeDefinition, ISqlColumnTypeDefinition<T>, ISqlColumnTypeDefinition where T : notnull

Type Parameters

T

Underlying .NET type.

Inheritance
SqlColumnTypeDefinition<T>
Implements
Derived
Inherited Members
Extension Methods

Properties

DefaultValue

Specifies the default value for this type.

public SqlLiteralNode<T> DefaultValue { get; }

Property Value

SqlLiteralNode<T>

RuntimeType

Underlying .NET type.

public override sealed Type RuntimeType { get; }

Property Value

Type

Methods

ToDbLiteral(T)

Creates an inline DB literal representation of the provided value.

[Pure]
public abstract string ToDbLiteral(T value)

Parameters

value T

Value to convert.

Returns

string

DB literal from value.

ToParameterValue(T)

Creates an object from the provided value that can be used to set DB parameter's Value with.

[Pure]
public abstract object ToParameterValue(T value)

Parameters

value T

Value to convert.

Returns

object

Converted value.

TryToDbLiteral(object)

Attempts to create an inline DB literal representation of the provided value.

[Pure]
public override sealed string? TryToDbLiteral(object value)

Parameters

value object

Value 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 override sealed object? TryToParameterValue(object value)

Parameters

value object

Value to convert.

Returns

object

Converted value or null when it is not of the specified RuntimeType.