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

=>

var endTime = analysis.Select(x => x.EndTime).FirstOrDefault().AddDays(1);

NormalSubmission=analysis.Count(x=>x.FinishTime<= endTime),

把方法放到外面就可以了

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

  1. LINQ to Entities 不识别方法“System.DateTime AddDays(Double)

    今天本想在linq里按照时间筛选一下超时的数据,一共两个字段FeedBackTime(计划反馈时间).EndTime(实际反馈时间).需求是这样的,查找数据库里所有EndTime大于FeedBackT ...

  2. 关于.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 ...

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

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

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

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

  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 ToDateTime(System.String)' method

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

  7. LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression

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

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

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

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

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

随机推荐

  1. 设置光标聚焦输入框(EditText)并弹出软键盘(在适配器中设置)

    参考代码: public void setFocusEditTextAndShowSoftInput(final EditText editText){ editText.setFocusable(t ...

  2. 未能执行URL

    在 <compilation debug="true"> 下 加入: <buildProviders> <add extension=".h ...

  3. 2018-2019-2 《网络对抗技术》Kali安装 Week1 20165236

    2018-2019-2 <网络对抗技术>Kali安装 Week1 20165236 一.kali 下载 安装 网络 共享 软件源 二.安装步骤 1.官网上下载kali Linux: 2.参 ...

  4. condition版生产者与消费者模式

    1.简介 在爬虫中,生产者与消费者模式是经常用到的.我能想到的比较好的办法是使用redis或者mongodb数据库构造生产者消费者模型.如果直接起线程进行构造生产者消费者模型,线程容易假死,也难以构造 ...

  5. encodeURIComponent 和 decodeURIComponent 对字符串url编码 用于url拼字符传值

  6. JDBC(Java Data Base Connectivity,java数据库连接)

    JDBC概述 JDBC(Java Data Base Connectivity,java数据库连接)是一种用于执行SQL语句的Java API,可以为多种关系数据库提供统一访问,它由一组用Java语言 ...

  7. 将 notepad++ 添加到鼠标右键菜单 带图标

    1.打开注册表编辑器,HKEY_CLASSES_ROOT\*\shell目录点击右键.新建-->项,这里命名的项则就是鼠标右键列表里面显示的内容,这里起名为[Edit With Notepad+ ...

  8. Django框架详细介绍---中间件(认证)

    一.绪论 在cookie和session的应用中,通过在视图函数内添加装饰器判断用户是否登录,把没有登录的用户请求跳转到登录页面,通过给几个特定视图函数加装饰器实现了这个需求.但是以后添加的视图函数可 ...

  9. Vue与React的异同

    众所周知,前端现在最火的两个框架是Vue和React了.通过一段时间的学习与项目上的实践,我想通过比较他们之间的异同点来发现以后在项目的技术选型中知道怎么抉择用哪个.有一点说明的是他们各自有自己的优势 ...

  10. ansible批量管理

    编写批量安装脚本 [root@m01 scripts]# vim install.sh for ip in $* do echo "=======start install to $ip = ...