Table of Contents

Class SqlDefaultValueExpression

Namespace
LinqToDB.Internal.SqlQuery
Assembly
linq2db.dll

The default a reader substitutes for a NULL in a column that cannot be NULL as declared, read by a calculation of the projection. A provider writes it as the value, or as the least value of the column's type where the type cannot hold it.

public sealed class SqlDefaultValueExpression : SqlExpressionBase, ISqlExpression, IQueryElement, IEquatable<ISqlExpression>
Inheritance
object
SqlDefaultValueExpression
Implements
Inherited Members
Extension Methods

Constructors

SqlDefaultValueExpression(DbDataType, object?)

Creates the default of a column of type type.

public SqlDefaultValueExpression(DbDataType type, object? value)

Parameters

type DbDataType

The column's type.

value object

The default the reader substitutes for a NULL.

Properties

ElementType

AST node type.

public override QueryElementType ElementType { get; }

Property Value

QueryElementType

Precedence

public override int Precedence { get; }

Property Value

int

SystemType

public override Type? SystemType { get; }

Property Value

Type

Type

The column's type.

public DbDataType Type { get; }

Property Value

DbDataType

Value

The default the reader substitutes for a NULL.

public object? Value { get; }

Property Value

object

Methods

Accept(QueryElementVisitor)

Visitor support.

public override IQueryElement Accept(QueryElementVisitor visitor)

Parameters

visitor QueryElementVisitor

Returns

IQueryElement

CanBeNullable(NullabilityContext)

public override bool CanBeNullable(NullabilityContext nullability)

Parameters

nullability NullabilityContext

Returns

bool

Equals(ISqlExpression, Func<ISqlExpression, ISqlExpression, bool>)

public override bool Equals(ISqlExpression other, Func<ISqlExpression, ISqlExpression, bool> comparer)

Parameters

other ISqlExpression
comparer Func<ISqlExpression, ISqlExpression, bool>

Returns

bool

GetElementHashCode()

public override int GetElementHashCode()

Returns

int

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString(QueryElementTextWriter)

Generates debug text representation of AST node.

public override QueryElementTextWriter ToString(QueryElementTextWriter writer)

Parameters

writer QueryElementTextWriter

Returns

QueryElementTextWriter