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

Treat-as 类型的类型元数据。

返回

使用指定的参数和类型的新 DbTreatExpression。

例外

argument 或 treatType 为 null。

treatType 与参数的结果类型不在同一类型层次结构中。

适用于