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 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.的更多相关文章
- LINQ to Entities 不识别方法“System.DateTime AddDays(Double)
今天本想在linq里按照时间筛选一下超时的数据,一共两个字段FeedBackTime(计划反馈时间).EndTime(实际反馈时间).需求是这样的,查找数据库里所有EndTime大于FeedBackT ...
- 关于.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 ...
- 报错:System.NotSupportedException: LINQ to Entities does not recognize the method
报错:System.NotSupportedException: LINQ to Entities does not recognize the method ...... get_Item(Int3 ...
- mvc ef LINQ to Entities 不识别方法“Int32 Parse(System.String)”,因此该方法无法转换为存储表达式。
private sys_User GetUserInfo() { sys_User model = null; var userId = Convert.ToInt32(AccountHelper.G ...
- 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. ...
- 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 ...
- 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 ...
- 报错: LINQ to Entities 不识别方法“Int32 Parse(System.String)
断点调试发现报错的语句为: public ActionResult SomeMethod(string someId) { var temp = SomeService.LoadEntities(a ...
- LINQ to Entities 不识别方法“Int32 ToInt32(System.String)”,因此该方法无法转换为存储表达式。
通常原始代码如下: Where id=Convert.ToInt32(cousid) 更改后代码: Var currentid= Convert.ToInt32(cousid); Wehre id ...
随机推荐
- API网关学习及介绍
一.什么是API网关 API网关是一个服务器,是系统的后端统一入口.首先,它会提供最基本的路由服务,将调用转发到上游服务.其次,作为一个入口,它还可以进行认证,鉴权,限流等操作,对上游服务保护.所以说 ...
- angular当router使用userhash:false时路由404问题
angular当router使用userhash:false时路由404问题 安装iis urlrewrite2.0组件 在根目录下创建 Web.config <configuration> ...
- Extjs6 grid 导出excel功能类,支持renderer
/* grid 导出excel扩展(纯客户端,提交到后台再导的可以自己改改代码也在) 参考自 https://blog.csdn.net/tianxiaode/article/details/4596 ...
- program与module
program,各方面与module都类似,其中声明的变量在program中都可见, 生命周期也是static类型的, program的结束,也是需要等待其中的所有initial块都执行结束. 与mo ...
- Windows上IOCP Socket事件模型管理
1.IOCP 2.使用IOCP 1)创建完成端口CreateIoCompletionPort: 2)向完成端口添加管理句柄与管理用户数据: 3)异步发送一个管理的事件请求: 4)开启工作线程来处理I ...
- 《ASP.NET Core In Action》读书笔记系列一 ASP.NET Core 的诞生
最近打算系统学习一下asp.net core ,苦于没有好的中文书藉,只好找来一本英文的 <ASP.NET Core In Action>学习.我和多数人一样,学习英文会明显慢于中文.希 ...
- ls file less
ls-a 列出所有文件,包含隐藏文件-l 以长格式显示结果-F 在所列出的文件后面显示其格式-r 按照文件名降序展示-t 按照时间列出-S 按照文件大小排序 file 文件名:展示文件的类型简单描述 ...
- document.wrtie()用法
推荐看这篇文章,非常的好 http://www.softwhy.com/article-8326-1.html
- 激光三角法点云重建分享——halcon 方法
如今视觉应用方面单纯依靠2D图像解决问题存在很多问题.稳定性差.定位不准确.还有配合机器人抓取方面只能抓高度一致的物品.其实在Halcon算法库有非常强大的三维算法.包括点云重建.激光三角法(2D相机 ...
- 关于 mysql2 -v '0.3.21'(CentOS7.3)
个人由于没有安装mysql而是装的MariaDB,所以网上说安装mysql,故没有采用,经查阅资料后,详细情况如下: Gem时报错: [root@localhost ~]# gem install m ...