DbExpressionBuilder.CastTo(DbExpression, TypeUsage) 方法

定义

创建一个新的 DbCastExpression ,该表达式对多态参数应用强制转换运算。

public static System.Data.Entity.Core.Common.CommandTrees.DbCastExpression CastTo (this System.Data.Entity.Core.Common.CommandTrees.DbExpression argument, System.Data.Entity.Core.Metadata.Edm.TypeUsage toType);
static member CastTo : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Metadata.Edm.TypeUsage -> System.Data.Entity.Core.Common.CommandTrees.DbCastExpression
<Extension()>
Public Function CastTo (argument As DbExpression, toType As TypeUsage) As DbCastExpression

参数

argument
DbExpression

应对其应用强制转换的参数。

toType
TypeUsage

指定要强制转换成的类型的类型元数据。

返回

使用指定的参数和目标类型的新 DbCastExpression。

例外

Argument 或 toType 为 null。

指定的强制转换无效。

适用于