DbExpressionBuilder.TreatAs(DbExpression, TypeUsage) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會產生一個新的 DbTreatExpression。
public static System.Data.Entity.Core.Common.CommandTrees.DbTreatExpression TreatAs(this System.Data.Entity.Core.Common.CommandTrees.DbExpression argument, System.Data.Entity.Core.Metadata.Edm.TypeUsage treatType);
static member TreatAs : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Metadata.Edm.TypeUsage -> System.Data.Entity.Core.Common.CommandTrees.DbTreatExpression
<Extension()>
Public Function TreatAs (argument As DbExpression, treatType As TypeUsage) As DbTreatExpression
參數
- argument
- DbExpression
一個用來指定實例的表達式。
- treatType
- TypeUsage
treat-as 型別的型別元資料。
傳回
一個新的 DbTreatExpression,並帶有指定的參數與型態。
例外狀況
參數或 treatType 為 null。
treatType 與參數的結果類型不在同一類型階層中。