Class InExpression
- Namespace
- Microsoft.EntityFrameworkCore.Query.SqlExpressions
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
An expression that represents an IN operation 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 InExpression : SqlExpression, IPrintableExpression
- Inheritance
-
InExpression
- Implements
-
IPrintableExpression
- Inherited Members
Constructors
InExpression(SqlExpression, SelectExpression, bool, RelationalTypeMapping)
Creates a new instance of the InExpression class which represents a item
IN subquery expression.
public InExpression(SqlExpression item, SelectExpression subquery, bool negated, RelationalTypeMapping typeMapping)
Parameters
item
SqlExpressionAn item to look into values.
subquery
SelectExpressionA subquery in which item is searched.
negated
boolA value indicating if the item should be present in the values or absent.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
InExpression(SqlExpression, SqlExpression, bool, RelationalTypeMapping)
Creates a new instance of the InExpression class which represents a item
IN values expression.
public InExpression(SqlExpression item, SqlExpression values, bool negated, RelationalTypeMapping typeMapping)
Parameters
item
SqlExpressionAn item to look into values.
values
SqlExpressionA list of values in which item is searched.
negated
boolA value indicating if the item should be present in the values or absent.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
Properties
IsNegated
The value indicating if item should be present in the values or absent.
public virtual bool IsNegated { get; }
Property Value
Item
The item to look into values.
public virtual SqlExpression Item { get; }
Property Value
Subquery
The subquery to search item in.
public virtual SelectExpression? Subquery { get; }
Property Value
Values
The list of values to search item in.
public virtual SqlExpression? Values { get; }
Property Value
Methods
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Negate()
Negates this expression by changing presence/absence state indicated by IsNegated.
public virtual InExpression Negate()
Returns
- InExpression
An expression which is negated form of this expression.
Print(ExpressionPrinter)
protected override void Print(ExpressionPrinter expressionPrinter)
Parameters
expressionPrinter
ExpressionPrinter
Update(SqlExpression, SqlExpression?, SelectExpression?)
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 InExpression Update(SqlExpression item, SqlExpression? values, SelectExpression? subquery)
Parameters
item
SqlExpressionThe Item property of the result.
values
SqlExpressionThe Values property of the result.
subquery
SelectExpressionThe Subquery property of the result.
Returns
- InExpression
This expression if no children changed, or an expression with the updated children.
VisitChildren(ExpressionVisitor)
protected override Expression VisitChildren(ExpressionVisitor visitor)
Parameters
visitor
ExpressionVisitor