Class SqlDefaultValueExpression
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
-
objectSqlDefaultValueExpression
- 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
typeDbDataTypeThe column's type.
valueobjectThe default the reader substitutes for a NULL.
Properties
ElementType
AST node type.
public override QueryElementType ElementType { get; }
Property Value
Precedence
public override int Precedence { get; }
Property Value
SystemType
public override Type? SystemType { get; }
Property Value
Type
The column's type.
public DbDataType Type { get; }
Property Value
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
visitorQueryElementVisitor
Returns
CanBeNullable(NullabilityContext)
public override bool CanBeNullable(NullabilityContext nullability)
Parameters
nullabilityNullabilityContext
Returns
Equals(ISqlExpression, Func<ISqlExpression, ISqlExpression, bool>)
public override bool Equals(ISqlExpression other, Func<ISqlExpression, ISqlExpression, bool> comparer)
Parameters
otherISqlExpressioncomparerFunc<ISqlExpression, ISqlExpression, bool>
Returns
GetElementHashCode()
public override int GetElementHashCode()
Returns
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
writerQueryElementTextWriter