【发布时间】:2016-02-25 03:54:00
【问题描述】:
我正在尝试在 LINQ 中进行字母比较,但无法在 SQL 中编译表达式。
有什么提示吗?
建议的答案不起作用。我明白了:
The LINQ expression '(Compare([f].str1, str2, Ordinal) < 0)' could not be translated and will be evaluated locally.
更新:我正在使用 http://www.albahari.com/nutshell/predicatebuilder.aspx 中的 PredicateBuilder
【问题讨论】:
-
如果str是字符串就写(str1
-
@Seb:你希望它怎么编译?没有
<(string, string)运算符。 -
@Seb 你不能在字符串上测试不等式
标签: entity-framework linq