Strange behavior when compare DateTime
Arestis opened this issue · comments
Orest P. commented
Hi. Next line works fine
Query.Where(s => s.Id == id && listOfDate.Any(d => d == s.Date));
but this one Query.Where(s => s.Id == id && listOfDate.Any(d => d > s.Date));
throw invalidOperationException which said that can`t translate query
if thats normal behavior please explain why second line doesnt work?
Steve Smith commented
If you try the same thing directly with a dbContext, I assume you will see the same error. It's an issue with how EF Core translates LINQ to SQL and what it supports (I'm 99% sure).
Fati Iseni commented
Closing the issue.