在我的 [项目中,我使用的是 MySQL 连接器和实体框架。我对以下代码有疑问:
int now = DateTime.Now.DayOfYear;
var items = (from e in db.Table1
let date = e.Created.AddDays(90)
where date.DayOfYear > now
select e).ToList();
但我收到错误消息:
LINQ to Entities does not recognize the method 'System.DateTime AddDays(Double)'
method, and this method cannot be translated into a store expression.
如何解决?