语言

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。

例外

参数或 toType 为 null。

指定的强制转换无效。

适用于