In my application, I am using Entity Framework.
My table
-Article -period -startDate
I need records that match => DateTime.Now > startDate and (startDate + period) > DateTime.Now
I tried this code but now it works
Context.Article .Where(p => p.StartDate < DateTime.Now) .Where(p => p.StartDate.AddDays(p.Period) > DateTime.Now)
When I run my code, the following exception occurs
LINQ to Entities does not recognize the 'System.DateTime AddDays (Double)' method, and this method cannot be translated into a storage expression.
c # datetime linq entity-framework
Yucel Nov 10 2018-10-10 15:51
source share