DbExpressionBuilder.Case Méthode

Définition

Crée un nouveau 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

Paramètres

whenExpressions
IEnumerable<DbExpression>

Liste d’expressions qui fournissent le conditionnel pour chaque cas.

thenExpressions
IEnumerable<DbExpression>

Liste d’expressions qui fournissent le résultat de chaque cas.

elseExpression
DbExpression

Expression qui définit le résultat lorsqu’aucun cas n’est mis en correspondance.

Retours

Nouvelle DbCaseExpression avec les cas et le résultat par défaut spécifiés.

Exceptions

whenExpressions ou thenExpressions a la valeur Null ou contient null, ou elseExpression a la valeur Null.

whenExpressions ou thenExpressions est vide ou whenExpressions contient une expression avec un type de résultat non booléen, ou aucun type de résultat commun n’existe pour toutes les expressions dans thenExpressions et elseExpression.

S’applique à