DbExpressionBuilder.Negate 方法
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
创建一个新的 DbArithmeticExpression,它对参数值求反。
命名空间: System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
<ExtensionAttribute> _
Public Shared Function Negate ( _
argument As DbExpression _
) As DbArithmeticExpression
用法
Dim argument As DbExpression
Dim returnValue As DbArithmeticExpression
returnValue = argument.Negate()
public static DbArithmeticExpression Negate(
this DbExpression argument
)
[ExtensionAttribute]
public:
static DbArithmeticExpression^ Negate(
DbExpression^ argument
)
static member Negate :
argument:DbExpression -> DbArithmeticExpression
public static function Negate(
argument : DbExpression
) : DbArithmeticExpression
参数
- argument
类型:System.Data.Entity.Core.Common.CommandTrees.DbExpression
指定参数的表达式。
返回值
类型:System.Data.Entity.Core.Common.CommandTrees.DbArithmeticExpression
表示求反运算的一个新的 DbArithmeticExpression。
使用说明
在 Visual Basic 和 C# 中,可以在 DbExpression 类型的任何对象上将此方法作为实例方法来调用。当使用实例方法语法调用此方法时,请省略第一个参数。有关详细信息,请参阅https://msdn.microsoft.com/zh-cn/library/bb384936(v=vs.113)或https://msdn.microsoft.com/zh-cn/library/bb383977(v=vs.113)。
异常
例外 | 条件 |
---|---|
ArgumentNullException | argument 为 null。 |
ArgumentException | 不存在针对 argument 的任何数值结果类型。 |
请参阅
参考
System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder 命名空间