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),

把方法放到外面就可以了

posted @ 2018-09-13 09:08  yomi丶  阅读(795)  评论(1编辑  收藏  举报