Condividi tramite


DbExpressionBuilder.Case Metodo

Definizione

Crea un nuovo oggetto DbCaseExpression.

public:
 static System::Data::Common::CommandTrees::DbCaseExpression ^ Case(System::Collections::Generic::IEnumerable<System::Data::Common::CommandTrees::DbExpression ^> ^ whenExpressions, System::Collections::Generic::IEnumerable<System::Data::Common::CommandTrees::DbExpression ^> ^ thenExpressions, System::Data::Common::CommandTrees::DbExpression ^ elseExpression);
public static System.Data.Common.CommandTrees.DbCaseExpression Case (System.Collections.Generic.IEnumerable<System.Data.Common.CommandTrees.DbExpression> whenExpressions, System.Collections.Generic.IEnumerable<System.Data.Common.CommandTrees.DbExpression> thenExpressions, System.Data.Common.CommandTrees.DbExpression elseExpression);
static member Case : seq<System.Data.Common.CommandTrees.DbExpression> * seq<System.Data.Common.CommandTrees.DbExpression> * System.Data.Common.CommandTrees.DbExpression -> System.Data.Common.CommandTrees.DbCaseExpression
Public Function Case (whenExpressions As IEnumerable(Of DbExpression), thenExpressions As IEnumerable(Of DbExpression), elseExpression As DbExpression) As DbCaseExpression

Parametri

whenExpressions
IEnumerable<DbExpression>

Elenco di espressioni che forniscono la logica condizionale di ogni caso.

thenExpressions
IEnumerable<DbExpression>

Elenco di espressioni che forniscono il risultato di ogni caso.

elseExpression
DbExpression

Espressione che definisce il risultato in assenza di corrispondenza con i casi elencati.

Restituisce

Nuovo DbCaseExpression con i casi specificati e il risultato predefinito.

Eccezioni

whenExpressions o thenExpressions è null, contiene null oppure elseExpression è null.

whenExpressions o thenExpressions è vuoto o whenExpressions contiene un'espressione con un tipo di risultato non booleano oppure non esiste alcun tipo di risultato comune per tutte le espressioni in thenExpressions e elseExpression.

Si applica a