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 ...
随机推荐
- OSPF(Open Shortest Path First)
1.概述 路由协议OSPF全称为Open Shortest Path First,也就开放的最短路径优先协议,因为OSPF是由IETF开发的,所以所有厂商都可以用. OSPF的流量使用IP协议号. O ...
- Python字符串常用方法(一)
一.字符串的判断常用方法 字符串的字母,数字,大小写,空格等的判断 1.string. isalnum() :(字母数字判断) 如果 string 至少有一个字符并且所有字符都是字母或数字则返回 Tr ...
- ESP8266开发笔记
自1999年MIT的Kevin Ash-ton教授首次提出物联网(IoT)的概念至今已经有20年了.放眼现在国内外的物联网市场,真可谓是百家争鸣,方兴未艾,无数家软硬件公司在这里舞浪弄潮,逐鹿其中,上 ...
- Oracle 10053
[10053]alter session set events '10053 trace name context forever,level 1'; <Run your SQL here;&g ...
- c++简单程序设计 实验一
实验内容: 2-28 实现一个简单的菜单程序,运行时显示“Menu:A(dd) D(elete) S(ort) Q(uit),Selete one:”提示用户输入.A表示增加,D表示删除, S表示排序 ...
- test request&&response 代码实现
使用工具 IDEA 创建一个登录页面和后方数据库连接 1.编写login.html文件 导入到web文件夹下 设置配置文件 druid.properties 导入jar包 放置到web文件夹下 ...
- [MSF]server/capture/http_javascript_keylogger键盘记录
server/capture/http_javascript_keylogger DEMO使用的官方的效果图: 使用方法: show options 看看 msf auxiliary(server/c ...
- MySQL学习——标识符语法和命名规则
转自:http://blog.csdn.net/notbaron/article/details/50868485 欢迎转载,转载请标明出处:http://blog.csdn.net/notbaron ...
- 利用Oracle Database Resource Manager实现UNDO表空间的quota
1.查出当前使用的是哪个resource plan select * from GV$RSRC_PLAN 2.创建pending area begin dbms_resource_manager.c ...
- git反悔
Checkout checkout命令用于从历史提交(或者暂存区域)中拷贝文件到工作目录,也可用于切换分支.  ![ ...