title: EF Core Where Clause throws Exception when Comparing date with datenow
body: <p>I have a Query method which is supposed to give me the next matches from today's date till 7 days, given a league ID. So if todays date is 2019-10-11 then it should give me all the sports matches till 2019-10-18. </p>
  
  <pre><code>        public IQueryable&lt;MatchDTO&gt; GetMatchesForNextSevenDaysByLeagueAsync(int leagueId)
          {
              var todayDate = DateTime.Now;
              var matches = _context.Matches.Include(e =&gt; e.HomeTeam).Include(e =&gt; e.AwayTeam).Include(e =&gt; e.League).Where(m =&gt; m.LeagueId == leagueId).OrderBy(m =&gt; m.MatchDate).ThenBy(m =&gt; m.Time).Where(m =&gt; ((todayDate - m.MatchDate).Days) &lt;=7).Select(m =&gt; DTOConverter.ConvertMatchToDTO(m));
  
              return matches;
          }
  </code></pre>
  
  <p>The call throws an exception:</p>
  
  <pre><code>"The LINQ expression 'Where&lt;Match&gt;(\r\n    source: 
  ThenBy&lt;Match, DateTime&gt;(\r\n        source: OrderBy&lt;Match, DateTime&gt;(\r\n            
  source: Where&lt;Match&gt;(\r\n                source: DbSet&lt;Match&gt;, \r\n                
  predicate: (m) =&gt; m.LeagueId == (Unhandled parameter: __leagueId_0)), \r\n            
  keySelector: (m) =&gt; m.MatchDate), \r\n        keySelector: (m) =&gt; m.Time), \r\n    
  predicate: (m) =&gt; m.MatchDate - (Unhandled parameter: __todayDate_1).TotalDays &lt;= 7)' 
  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."
  </code></pre>
  
  <p>For me it looks like it does not like the way I compare the dates in <code>.Where(m =&gt; ((todayDate - m.MatchDate).Days) &lt;=7)</code></p>
  
  <p>I have tried to use client evaluation but it is too slow. Any thoughts on how I could rewrite this so the code would work.</p>
  
  <p>Note that I am using EF Core 3.0</p>