LINQ to Entities does not recognize the method 'System.DateTime AddDays(Double)' method, and this method cannot be translated into a store expression.时间:2023-03-08 16:38:49 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), 把方法放到外面就可以了