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
所要視為之目標型別的型別中繼資料。
傳回
含有指定之引數及型別的新 DbTreatExpression。
例外狀況
argument 或 treatType 為 null。
treatType 不在與引數結果型別相同的類型階層中。