当我在实体框架中执行这些运算符(>
和) lambda 表达式时。>=
两者都得到相同的结果。
db.Companies.where(Company => (Compare(Convert(Company.Name), "y") > 0))
db.Companies.where(Company => (Compare(Convert(Company.Name), "y") >= 0))
是 Lambda 表达式比较运算符的问题吗?我改成
db.Companies.where(Company => (Compare(Convert(Company.Name), "y") > 1))
- 没结果。它不正确db.Companies.where(Company => (Compare(Convert(Company.Name), "y") >= 1))
- 64 个结果
源代码
case operatorType.Greater: return Expression.GreaterThan(Expression.Call(typeof(string),
"Compare", null, new[] { argLeft, argRight }),
Expression.Constant(1, typeof(int)));
case operatorType.GreaterEqual: return Expression.GreaterThanOrEqual( Expression.Call(typeof(string), "Compare", null, new[] { argLeft, argRight }),
Expression.Constant(1, typeof(int)));