SqlExpressionFactory.Case 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Case(SqlExpression, CaseWhenClause[]) |
已淘汰.
建立新的 CaseExpression ,代表 SQL 樹狀結構中的 CASE 語句。 |
Case(IReadOnlyList<CaseWhenClause>, SqlExpression) |
建立新的 CaseExpression ,代表 SQL 樹狀結構中的 CASE 語句。 |
Case(SqlExpression, SqlExpression, CaseWhenClause[]) | |
Case(SqlExpression, IReadOnlyList<CaseWhenClause>, SqlExpression) |
建立新的 CaseExpression ,代表 SQL 樹狀結構中的 CASE 語句。 |
Case(SqlExpression, CaseWhenClause[])
警告
Use overload which takes IReadOnlyList instead of params
建立新的 CaseExpression ,代表 SQL 樹狀結構中的 CASE 語句。
public virtual 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 virtual 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
override this.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
override this.Case : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause[] -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression
Public Overridable Function Case (operand As SqlExpression, ParamArray whenClauses As CaseWhenClause()) As CaseExpression
參數
- operand
- SqlExpression
與 中比較 Test 的 whenClauses
運算式。
- whenClauses
- CaseWhenClause[]
要比較和取得結果的 清單 CaseWhenClause 。
傳回
運算式,表示 SQL 樹狀結構中的 CASE 語句。
實作
- 屬性
適用於
Case(IReadOnlyList<CaseWhenClause>, SqlExpression)
建立新的 CaseExpression ,代表 SQL 樹狀結構中的 CASE 語句。
public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression Case (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> whenClauses, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression elseResult);
public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression 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
override this.Case : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause> * Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression
Public Overridable Function Case (whenClauses As IReadOnlyList(Of CaseWhenClause), elseResult As SqlExpression) As CaseExpression
參數
- whenClauses
- IReadOnlyList<CaseWhenClause>
要評估條件並從中取得結果的 清單 CaseWhenClause 。
- elseResult
- SqlExpression
如果沒有 whenClauses
相符專案,則傳回的值。如果有的話。
傳回
運算式,表示 SQL 樹狀結構中的 CASE 語句。
實作
適用於
Case(SqlExpression, SqlExpression, CaseWhenClause[])
public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression Case (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression operand, Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression elseResult, params Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause[] whenClauses);
abstract member Case : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause[] -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression
override this.Case : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseWhenClause[] -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.CaseExpression
Public Overridable Function Case (operand As SqlExpression, elseResult As SqlExpression, ParamArray whenClauses As CaseWhenClause()) As CaseExpression
參數
- operand
- SqlExpression
- elseResult
- SqlExpression
- whenClauses
- CaseWhenClause[]
傳回
適用於
Case(SqlExpression, IReadOnlyList<CaseWhenClause>, SqlExpression)
建立新的 CaseExpression ,代表 SQL 樹狀結構中的 CASE 語句。
public virtual 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 virtual 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
override this.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 Overridable Function Case (operand As SqlExpression, whenClauses As IReadOnlyList(Of CaseWhenClause), elseResult As SqlExpression) As CaseExpression
參數
- operand
- SqlExpression
與 中比較 Test 的 whenClauses
運算式。
- whenClauses
- IReadOnlyList<CaseWhenClause>
要比較和取得結果的 清單 CaseWhenClause 。
- elseResult
- SqlExpression
如果沒有 whenClauses
相符專案,則傳回的值。如果有的話。
傳回
運算式,表示 SQL 樹狀結構中的 CASE 語句。