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
Inheritance
FromSqlExpression
Implements
IPrintableExpression
Inherited Members

Constructors

FromSqlExpression(string, Expression, string)

Creates a new instance of the FromSqlExpression class.

[Obsolete("Use the constructor which takes alias as first argument.")]
public FromSqlExpression(string sql, Expression arguments, string alias)

Parameters

sql string

A user-provided custom SQL for the table source.

arguments Expression

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

alias string

A string alias for the table source.

FromSqlExpression(string, string, Expression)

Creates a new instance of the FromSqlExpression class.

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

Parameters

alias string

A string alias for the 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

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

Methods

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