共用方式為


DbExpressionBuilder.TreatAs(DbExpression, TypeUsage) 方法

定義

建立新的 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 不在與引數結果型別相同的類型階層中。

適用於