【发布时间】:2009-09-24 09:01:49
【问题描述】:
我有这段代码:
fee.SingleOrDefault(f => 100.05M >= f.Rate);
在数据库中,Fee.Rate 是一个使用不变文化存储的货币字段。但是使用此选择会出错,因为我当前的文化会将“100.05”转换为“100,05”,从而导致;
An expression of non-boolean type specified in a context where a condition is expected, near ','.
最好的方法是什么?
【问题讨论】:
-
删除我的答案,因为它没有帮助。
-
我现在唯一能想到的: - 将当前文化切换为不变 - 执行查询 - 恢复当前文化
标签: linq subsonic3 expression culture