ardalis / Specification

Base class with tests for adding specifications to a DDD model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange behavior when compare DateTime

Arestis opened this issue · comments

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?

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).

@ardalis Thanks. I found that I can use PostProcessing for my case

Closing the issue.