LINQ to Entities does not recognize the method 'System.DateTime AddSeconds(Double)' method, and this method cannot be translated into

前端 未结 1 1524
夕颜
夕颜 2020-12-18 18:26

I receive this error on

base {System.SystemException} = {\"LINQ to Entities does not recognize the method \'System.DateTime AddSeconds(Double)\' method, an         


        
1条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 19:00

    Use EntityFunctions.AddSeconds method to create date time on server side.

     .Where(x => x.DateTimeStart > currentDateTime && 
                 currentDateTime >= EntityFunctions.AddSeconds(x.DateTimeStart, x.ReminderTime))
    

    0 讨论(0)
提交回复
热议问题