Condividi tramite


DbExpressionBuilder.CastTo(DbExpression, TypeUsage) Metodo

Definizione

Crea una nuova espressione DbCastExpression che applica un'operazione di cast a un argomento polimorfico.

public static System.Data.Entity.Core.Common.CommandTrees.DbCastExpression CastTo (this System.Data.Entity.Core.Common.CommandTrees.DbExpression argument, System.Data.Entity.Core.Metadata.Edm.TypeUsage toType);
static member CastTo : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Metadata.Edm.TypeUsage -> System.Data.Entity.Core.Common.CommandTrees.DbCastExpression
<Extension()>
Public Function CastTo (argument As DbExpression, toType As TypeUsage) As DbCastExpression

Parametri

argument
DbExpression

Argomento a cui applicare il cast.

toType
TypeUsage

Metadati di Type che specificano il tipo a cui eseguire il cast.

Restituisce

Nuovo DbCastExpression con l'argomento e il tipo di destinazione specificati.

Eccezioni

L'argomento o toType è Null.

Il cast specificato non è valido.

Si applica a