Sdílet prostřednictvím


DbExpressionBuilder.Case Metoda

Definice

Vytvoří nový objekt 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

Parametry

whenExpressions
IEnumerable<DbExpression>

Seznam výrazů, které poskytují podmínku pro každý případ.

thenExpressions
IEnumerable<DbExpression>

Seznam výrazů, které poskytují výsledek každého případu.

elseExpression
DbExpression

Výraz, který definuje výsledek, pokud není shoda s žádným případem.

Návraty

Nový DbCaseExpression se zadanými případy a výchozím výsledkem.

Výjimky

whenExpressions nebo thenExpressions je null nebo obsahuje null, nebo elseExpression je null.

whenExpressions nebo thenExpressions je prázdný nebo whenExpressions obsahuje výraz s jiným než logickým typem výsledku nebo neexistuje žádný společný typ výsledku pro všechny výrazy v thenExpressions a elseExpression.

Platí pro