Table of Contents

Class SqlConstantExpression

Namespace
Microsoft.EntityFrameworkCore.Query.SqlExpressions
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

An expression that represents a constant in a SQL tree.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public class SqlConstantExpression : SqlExpression, IPrintableExpression
Inheritance
SqlConstantExpression
Implements
IPrintableExpression
Inherited Members

Constructors

SqlConstantExpression(ConstantExpression, RelationalTypeMapping)

Creates a new instance of the SqlConstantExpression class.

public SqlConstantExpression(ConstantExpression constantExpression, RelationalTypeMapping typeMapping)

Parameters

constantExpression ConstantExpression

A ConstantExpression.

typeMapping RelationalTypeMapping

The RelationalTypeMapping associated with the expression.

Properties

Value

The constant value.

public virtual object Value { get; }

Property Value

object

Methods

ApplyTypeMapping(RelationalTypeMapping)

Applies supplied type mapping to this expression.

public virtual SqlExpression ApplyTypeMapping(RelationalTypeMapping typeMapping)

Parameters

typeMapping RelationalTypeMapping

A relational type mapping to apply.

Returns

SqlExpression

A new expression which has supplied type mapping.

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Print(ExpressionPrinter)

protected override void Print(ExpressionPrinter expressionPrinter)

Parameters

expressionPrinter ExpressionPrinter

VisitChildren(ExpressionVisitor)

protected override Expression VisitChildren(ExpressionVisitor visitor)

Parameters

visitor ExpressionVisitor

Returns

Expression