错误信息:
"LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression."
Linq to Entities 无法识别 Int32 ToInt32(System.String) 方法。
原因分析:
Linq to Entities 不支持 使用 convert.ToInt32()方法。例如将字符串属性转换为整数。
解决办法:
1、缓存到本地,再进行转换。
2、避免使用此方法。
3、直接使用原始数据类型进行处理。