Compartilhar via


ISqlExpressionFactory.Case Method

Definition

Overloads

Case(SqlExpression, CaseWhenClause[])
Obsolete.

Creates a new CaseExpression which represent a CASE statement in a SQL tree.

Case(IReadOnlyList<CaseWhenClause>, SqlExpression)

Creates a new CaseExpression which represent a CASE statement in a SQL tree.

Case(SqlExpression, IReadOnlyList<CaseWhenClause>, SqlExpression)

Creates a new CaseExpression which represent a CASE statement in a SQL tree.

Case(SqlExpression, IReadOnlyList<CaseWhenClause>, SqlExpression, SqlExpression)

Creates a new CaseExpression which represent a CASE statement in a SQL tree.

Case(SqlExpression, CaseWhenClause[])

Caution

Use overload which takes IReadOnlyList instead of params

Creates a new CaseExpression which represent a CASE statement in a SQL tree.

public Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression Case (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression operand, params Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause[] whenClauses);
[System.Obsolete("Use overload which takes IReadOnlyList instead of params")]
public Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression Case (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression operand, params Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause[] whenClauses);
abstract member Case : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause[] -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression
[<System.Obsolete("Use overload which takes IReadOnlyList instead of params")>]
abstract member Case : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause[] -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression
Public Function Case (operand As SqlExpression, ParamArray whenClauses As CaseWhenClause()) As CaseExpression

Parameters

operand
SqlExpression

An expression to compare with Test in whenClauses.

whenClauses
CaseWhenClause[]

A list of CaseWhenClause to compare and get result from.

Returns

An expression representing a CASE statement in a SQL tree.

Attributes

Applies to

Case(IReadOnlyList<CaseWhenClause>, SqlExpression)

Source:
ISqlExpressionFactory.cs
Source:
ISqlExpressionFactory.cs
Source:
ISqlExpressionFactory.cs

Creates a new CaseExpression which represent a CASE statement in a SQL tree.

public Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression Case (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> whenClauses, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression elseResult);
public Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression Case (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> whenClauses, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression? elseResult);
public Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression Case (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> whenClauses, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression? elseResult);
abstract member Case : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> * Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression
abstract member Case : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> * Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression
Public Function Case (whenClauses As IReadOnlyList(Of CaseWhenClause), elseResult As SqlExpression) As CaseExpression
Public Function Case (whenClauses As IReadOnlyList(Of CaseWhenClause), elseResult As SqlExpression) As SqlExpression

Parameters

whenClauses
IReadOnlyList<CaseWhenClause>

A list of CaseWhenClause to evaluate condition and get result from.

elseResult
SqlExpression

A value to return if no whenClauses matches, if any.

Returns

An expression representing a CASE statement in a SQL tree.

Applies to

Case(SqlExpression, IReadOnlyList<CaseWhenClause>, SqlExpression)

Source:
ISqlExpressionFactory.cs
Source:
ISqlExpressionFactory.cs

Creates a new CaseExpression which represent a CASE statement in a SQL tree.

public Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression Case (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression operand, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> whenClauses, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression elseResult);
public Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression Case (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression operand, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> whenClauses, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression? elseResult);
abstract member Case : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> * Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression
Public Function Case (operand As SqlExpression, whenClauses As IReadOnlyList(Of CaseWhenClause), elseResult As SqlExpression) As CaseExpression

Parameters

operand
SqlExpression

An expression to compare with Test in whenClauses.

whenClauses
IReadOnlyList<CaseWhenClause>

A list of CaseWhenClause to compare and get result from.

elseResult
SqlExpression

A value to return if no whenClauses matches, if any.

Returns

An expression representing a CASE statement in a SQL tree.

Applies to

Case(SqlExpression, IReadOnlyList<CaseWhenClause>, SqlExpression, SqlExpression)

Source:
ISqlExpressionFactory.cs

Creates a new CaseExpression which represent a CASE statement in a SQL tree.

public Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression Case (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression? operand, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> whenClauses, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression? elseResult, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression? existingExpression = default);
abstract member Case : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> * Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression
Public Function Case (operand As SqlExpression, whenClauses As IReadOnlyList(Of CaseWhenClause), elseResult As SqlExpression, Optional existingExpression As SqlExpression = Nothing) As SqlExpression

Parameters

operand
SqlExpression

An expression to compare with Test in whenClauses.

whenClauses
IReadOnlyList<CaseWhenClause>

A list of CaseWhenClause to compare or evaluate and get result from.

elseResult
SqlExpression

A value to return if no whenClauses matches, if any.

existingExpression
SqlExpression

An optional expression that can be re-used if it matches the new expression.

Returns

An expression representing a CASE statement in a SQL tree.

Applies to