DbExpressionBuilder.CastTo(DbExpression, TypeUsage) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立一個新物件 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,包含指定的參數和目標型別。
例外狀況
argument 或 toType 為空值。
指定的鑄造組合不成立。