我收到此错误
base {System.SystemException} = {"LINQ to Entities does not recognize the method 'System.DateTime AddSeconds(Double)' method, and this method cannot be translated into a store expression."}
在这段代码上
var eventToPushCustom = eventCustomRepository.FindAllEventsCustomByUniqueStudentReference(userDevice.UniqueStudentReference)
.Where(x => x.DateTimeStart > currentDateTime && currentDateTime >= x.DateTimeStart.AddSeconds(x.ReminderTime))
.Select(y => new EventPushNotification
{
Id = y.EventId,
EventTitle = y.EventTitle,
DateTimeStart = y.DateTimeStart,
DateTimeEnd = y.DateTimeEnd,
Location = y.Location,
Description = y.Description,
DeviceToken = y.UsersDevice.DeviceTokenNotification
});
我相信问题出在 x.DateTimeStart.AddSeconds(x.ReminderTime)
.AddSeconds 在我的情况下的论点必须是“动态的”......知道如何解决它吗?