if (!string.IsNullOrEmpty(FarmWorkId))
{
data = data.Where(p => p.TypeId == Convert.ToInt32(FarmWorkId));
}

解决方法:

if (!string.IsNullOrEmpty(FarmWorkId))
{
int i = Convert.ToInt32(FarmWorkId);
data = data.Where(p => p.TypeId == i);
}

LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression的更多相关文章

  1. LINQ to Entities 不识别方法“Int32 ToInt32(System.String)”,因此该方法无法转换为存储表达式。

      通常原始代码如下: Where id=Convert.ToInt32(cousid) 更改后代码: Var currentid= Convert.ToInt32(cousid); Wehre id ...

  2. mvc ef LINQ to Entities 不识别方法“Int32 Parse(System.String)”,因此该方法无法转换为存储表达式。

    private sys_User GetUserInfo() { sys_User model = null; var userId = Convert.ToInt32(AccountHelper.G ...

  3. 关于.ToList(): LINQ to Entities does not recognize the method ‘xxx’ method, and this method cannot be translated into a store expression.

    LINQ to Entities works by translating LINQ queries to SQL queries, then executing the resulting quer ...

  4. 报错:System.NotSupportedException: LINQ to Entities does not recognize the method

    报错:System.NotSupportedException: LINQ to Entities does not recognize the method ...... get_Item(Int3 ...

  5. LINQ to Entities does not recognize the method , and this method cannot be translated into a store expression 解决办法

    根据用户输入的起始日期,查询以起始日期开始的前20条记录,在ASP.NET MVC的Controller代码中这样写: var Logs = db.Log.Take(20); if (!string. ...

  6. LINQ to Entities does not recognize the method 'System.DateTime AddDays(Double)' method, and this method cannot be translated into a store expression.

    NormalSubmission=analysis.Count(x=>x.FinishTime<= endTime.AddDays(1))报错linq不能识别 => var endT ...

  7. LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' method

    System.Data.Objects.EntityFunctions和System.Data.Objects.SqlClient.SqlFunctions中的方法进行比较,如下 where Syst ...

  8. 报错: LINQ to Entities 不识别方法“Int32 Parse(System.String)

    断点调试发现报错的语句为: public ActionResult SomeMethod(string someId) { var temp = SomeService.LoadEntities(a ...

  9. LINQ to Entities不支持Convert.ToDateTime方法解決一例

    錯誤提示: LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' met ...

随机推荐

  1. Linux:ssh端口转发详解

    ssh是个多用途的工具,不仅可以远程登录,还可以搭建socks代理.进行内网穿透,这是利用它的端口转发功能来实现的. 所谓ssh端口转发,就是在ssh连接的基础上,指定 ssh client 或 ss ...

  2. 【转载】解决Windows和Ubuntu时间不一致的问题

    大家在切换操作系统的时候会发现一个问题, Windows 和Ubuntu的时间会出现不一致的情况.在 Windows 中把时间设置正确了过后,回到在 Ubuntu 后系统的时间又不一样了,在 Ubun ...

  3. Paxos算法细节详解(一)

    Paxos分析 最近研究paxos算法,看了许多相关的文章,概念还是很模糊,觉得还是没有掌握paxos算法的精髓,所以花了3天时间分析了libpaxos3的所有代码,此代码可以从https://bit ...

  4. JDK工具(查看JVM参数、内存使用情况及分析等)

      在JDK的bin目录下有很多命令行工具: 我们可以看到各个工具的体积基本上都稳定在27kb左右,这个不是JDK开发团队刻意为之的,而是因为这些工具大多数是jdk\lib\tools.jar类库的一 ...

  5. css布局你该了解的

    记录一下: static :默认值:默认布局. fixed :固定定位:类似于absolute,但不随着滚动条的移动而改变位置. float: 给元素的float属性赋值后,就是脱离文档流,进行左右浮 ...

  6. 小米3移动版 分区 调整/合并教程(16GB/64GB)

    (必读)版权声明:米3移动版TWRP Recovery为XueferH适配,分区脚本以及双数据置换脚本的知识产权,智力成果权归XueferH所有. 注:此教程仅适用于Xiaomi MI 3-移动版(1 ...

  7. 【转】关于HTTP服务器每个客户端2个连接的限制

    http://www.cnblogs.com/lishenglyx/archive/2010/01/07/1641190.html 这两天猫在家里搞一个多线程的断点续传得C#程序,发现同时只能开2个线 ...

  8. LEARNING TO NAVIGATE IN COMPLEX ENVIRONMENTS

    任务是地图里面导航,让agent从起始点到达指定位置. 用了supervised learning + reinforcement learning + lstm 用supervised learni ...

  9. checkbox批量删除功能

    参考:http://www.jb51.net/article/35338.htm 感谢作者 代码片段:jsp <c:forEach items="${infolist }" ...

  10. 初识ZooKeeper与集群搭建实例

    原文链接:http://www.linuxidc.com/Linux/2015-02/114230.htm zookeeper是什么 Zookeeper,一种分布式应用的协作服务,是Google的Ch ...