DbExpressionBuilder.Case 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建一个新的 DbCaseExpression。
public static System.Data.Entity.Core.Common.CommandTrees.DbCaseExpression Case(System.Collections.Generic.IEnumerable<System.Data.Entity.Core.Common.CommandTrees.DbExpression> whenExpressions, System.Collections.Generic.IEnumerable<System.Data.Entity.Core.Common.CommandTrees.DbExpression> thenExpressions, System.Data.Entity.Core.Common.CommandTrees.DbExpression elseExpression);
static member Case : seq<System.Data.Entity.Core.Common.CommandTrees.DbExpression> * seq<System.Data.Entity.Core.Common.CommandTrees.DbExpression> * System.Data.Entity.Core.Common.CommandTrees.DbExpression -> System.Data.Entity.Core.Common.CommandTrees.DbCaseExpression
Public Function Case (whenExpressions As IEnumerable(Of DbExpression), thenExpressions As IEnumerable(Of DbExpression), elseExpression As DbExpression) As DbCaseExpression
参数
- whenExpressions
- IEnumerable<DbExpression>
提供每个 Case 的条件的表达式列表。
- thenExpressions
- IEnumerable<DbExpression>
提供每个 Case 的结果的表达式列表。
- elseExpression
- DbExpression
定义没有 Case 匹配时的结果的表达式。
返回
使用指定的案件和默认结果的新 DbCaseExpression。
例外
如果Expressions 或 thenExpressions 为 null 或包含 null,或 elseExpression 为 null。
如果Expressions 或 thenExpressions 为空,或者当Expressions 包含具有非布尔结果类型的表达式时,或者 thenExpressions 和 elseExpression 中的所有表达式都不存在通用结果类型。