I'm trying to run the following query:
List<EPCRA_Events> x =
_dbContext.EPCRA_Events
.Where(e => e.DueDt.HasValue &&
(e.DueDt.Value - DateTime.Now).Days < 30)
.ToList();
But I keep getting an error
The LINQ expression ...xxx... could not be translated
After reviewing other posts I've seen a common solution is using DbFunctions
class. However, after using Nuget to import Entity Framework 6.4.4 and Microsoft.EntityFrameworkCore
5.0.9, I don't have access to that class. Furthermore, the Entity
class isn't in the System.Data
namespace.
Any info on how I can get this query to run, or what I'm doing wrong using DbFunctions
would be appreciated. Thanks.