Table of Contents

Class FromSqlExpression

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

An expression that represents a subquery table source with user-provided custom SQL.

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

public class FromSqlExpression : TableExpressionBase, IPrintableExpression, IClonableTableExpressionBase
Inheritance
FromSqlExpression
Implements
IPrintableExpression
Inherited Members

Constructors

FromSqlExpression(ITableBase, string, Expression)

Creates a new instance of the FromSqlExpression class.

public FromSqlExpression(ITableBase defaultTableBase, string sql, Expression arguments)

Parameters

defaultTableBase ITableBase

A default table base associated with this table source.

sql string

A user-provided custom SQL for the table source.

arguments Expression

A user-provided parameters to pass to the custom SQL.

FromSqlExpression(string, string, Expression)

Creates a new instance of the FromSqlExpression class.

public FromSqlExpression(string alias, string sql, Expression arguments)

Parameters

alias string

An alias to use for this table source.

sql string

A user-provided custom SQL for the table source.

arguments Expression

A user-provided parameters to pass to the custom SQL.

Properties

Alias

The alias assigned to this table source.

public override string? Alias { get; }

Property Value

string

Arguments

The user-provided parameters passed to the custom SQL.

public virtual Expression Arguments { get; }

Property Value

Expression

Sql

The user-provided custom SQL for the table source.

public virtual string Sql { get; }

Property Value

string

Table

The ITableBase associated with given table source if any, null otherwise.

public virtual ITableBase? Table { get; }

Property Value

ITableBase

Methods

Clone()

public virtual TableExpressionBase Clone()

Returns

TableExpressionBase

CreateWithAnnotations(IEnumerable<IAnnotation>)

protected override TableExpressionBase CreateWithAnnotations(IEnumerable<IAnnotation> annotations)

Parameters

annotations IEnumerable<IAnnotation>

Returns

TableExpressionBase

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

Update(Expression)

Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.

public virtual FromSqlExpression Update(Expression arguments)

Parameters

arguments Expression

The Arguments property of the result.

Returns

FromSqlExpression

This expression if no children changed, or an expression with the updated children.

VisitChildren(ExpressionVisitor)

protected override Expression VisitChildren(ExpressionVisitor visitor)

Parameters

visitor ExpressionVisitor

Returns

Expression