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
ITableBaseA default table base associated with this table source.
sql
stringA user-provided custom SQL for the table source.
arguments
ExpressionA 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
stringAn alias to use for this table source.
sql
stringA user-provided custom SQL for the table source.
arguments
ExpressionA 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
Arguments
The user-provided parameters passed to the custom SQL.
public virtual Expression Arguments { get; }
Property Value
Sql
The user-provided custom SQL for the table source.
public virtual string Sql { get; }
Property Value
Table
The ITableBase associated with given table source if any, null otherwise.
public virtual ITableBase? Table { get; }
Property Value
Methods
Clone()
public virtual TableExpressionBase Clone()
Returns
CreateWithAnnotations(IEnumerable<IAnnotation>)
protected override TableExpressionBase CreateWithAnnotations(IEnumerable<IAnnotation> annotations)
Parameters
annotations
IEnumerable<IAnnotation>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
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
ExpressionThe 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