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 语句的表达式。