Table of Contents

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 SqlExpression

An item to look into values.

subquery SelectExpression

A subquery in which item is searched.

negated bool

A value indicating if the item should be present in the values or absent.

typeMapping RelationalTypeMapping

The 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 SqlExpression

An item to look into values.

values SqlExpression

A list of values in which item is searched.

negated bool

A value indicating if the item should be present in the values or absent.

typeMapping RelationalTypeMapping

The 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

bool

Item

The item to look into values.

public virtual SqlExpression Item { get; }

Property Value

SqlExpression

Subquery

The subquery to search item in.

public virtual SelectExpression? Subquery { get; }

Property Value

SelectExpression

Values

The list of values to search item in.

public virtual SqlExpression? Values { get; }

Property Value

SqlExpression

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

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 SqlExpression

The Item property of the result.

values SqlExpression

The Values property of the result.

subquery SelectExpression

The 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

Returns

Expression