DbExpressionBuilder.CastTo(DbExpression, TypeUsage) 方法

定義

建立一個新物件 DbCastExpression ,對多態參數套用鑄造操作。

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

參數

argument
DbExpression

這正是演員陣容應該被應用的論點。

toType
TypeUsage

類型中繼資料會指定要投射的類型。

傳回

一個新的 DbCastExpression,包含指定的參數和目標型別。

例外狀況

argumenttoType 為空值。

指定的鑄造組合不成立。

適用於