I am struggling to get documents expiring in less than 90 days:
var query = from doc in context.Documents
where doc.ExpirationDate <= DateOnly.FromDateTime(DateTime.Today.AddDays(90))
select { doc };
I know can achieve it with something like this context.Documents.Where(...), but this is just a part of a complex LINQ query, and the whole issue comes down to comparing the ExpirationDate (a DateOnly) with the current date plus 90 days
date. In EF Core the LINQ queries get translated to SQL. What you posted compares theExpirationDatecolumn with a parameter value generated on the client, egwhere ExpirationDate<= $1. The only weird thing isselect { doc }- why not just returndoc?