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
itemSqlExpressionAn item to look into values.
subquerySelectExpressionA subquery in which item is searched.
negatedboolA value indicating if the item should be present in the values or absent.
typeMappingRelationalTypeMappingThe 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
itemSqlExpressionAn item to look into values.
valuesSqlExpressionA list of values in which item is searched.
negatedboolA value indicating if the item should be present in the values or absent.
typeMappingRelationalTypeMappingThe RelationalTypeMapping associated with the expression.
InExpression(SqlExpression, bool, SelectExpression, RelationalTypeMapping)
Creates a new instance of the InExpression class which represents a item IN subquery expression.
[Obsolete("Use overload which passes negated argument after subquery argument.")]
public InExpression(SqlExpression item, bool negated, SelectExpression subquery, RelationalTypeMapping typeMapping)
Parameters
itemSqlExpressionAn item to look into values.
negatedboolA value indicating if the item should be present in the values or absent.
subquerySelectExpressionA subquery in which item is searched.
typeMappingRelationalTypeMappingThe RelationalTypeMapping associated with the expression.
InExpression(SqlExpression, bool, SqlExpression, RelationalTypeMapping)
Creates a new instance of the InExpression class which represents a item IN values expression.
[Obsolete("Use overload which passes negated argument after values argument.")]
public InExpression(SqlExpression item, bool negated, SqlExpression values, RelationalTypeMapping typeMapping)
Parameters
itemSqlExpressionAn item to look into values.
negatedboolA value indicating if the item should be present in the values or absent.
valuesSqlExpressionA list of values in which item is searched.
typeMappingRelationalTypeMappingThe 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
objobject
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
expressionPrinterExpressionPrinter
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
itemSqlExpressionThe Item property of the result.
valuesSqlExpressionThe Values property of the result.
subquerySelectExpressionThe 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
visitorExpressionVisitor