I'm fairly new to EF Core, and I am trying to filter a set of jobs based on whether the appointment date is in the past and the status.
Why would this result in an error?
var maxJobAgeDate = DateTime.Now.AddDays(-14);
JobSummaries.Where(j => DateTime.Parse(j.AppointmentDate) < maxJobAgeDate && j.JobStatus == JobStatus.CompleteSignOffConfirmed);
The error:
The LINQ expression 'DbSet .Where(j => DateTime.Parse(j.AppointmentDate) < __maxJobAgeDate_0 && (int)j.JobStatus == 4)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
I'm using EF Core.