title: "LINQ expression could not be translated" with DateTime comparison in LINQ query?
body: <p>I'm a newbie that just recently started using EF Core 5 for a project and am encountering an issue with the following query:</p>
  <pre><code>TimeSpan bookTimeToLive = TimeSpan.FromHours(10);
  IList&lt;Book&gt;? expiredBooks = dbContext.Value.Books.AsQueryable()
                      .Where(x =&gt; DateTime.UtcNow - x.UtcTimeStamp &gt; bookTimeToLive)
                      .ToList();
  
  // Get list of expired Books to remove them
  dbContext.Value.RemoveRange(expiredBooks);
  await dbContext.Value.SaveChangesAsync(cancellationToken);
  
  </code></pre>
  <p>My goal is to remove all Books that are expired (their timestamp is past the amount of time I want to keep track of them for).</p>
  <p>With that, I get the exception:</p>
  <pre><code>The LINQ expression 'DbSet&lt;Books&gt;()
      .Where(d =&gt; DateTime.UtcNow - d.UtcTimeStamp &gt; __bookTimeToLive_0)' 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 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See 
  https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
  </code></pre>
  <p>Upon some digging, I realized that this is because EF is unable to parse my DateTime comparison into the SQL query, so I attempted to use the DbFunctions.DateDiffHour() method from <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.sqlserverdbfunctionsextensions.datediffhour?view=efcore-5.0#Microsoft_EntityFrameworkCore_SqlServerDbFunctionsExtensions_DateDiffHour_Microsoft_EntityFrameworkCore_DbFunctions_System_DateTime_System_DateTime" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.sqlserverdbfunctionsextensions.datediffhour?view=efcore-5.0#Microsoft_EntityFrameworkCore_SqlServerDbFunctionsExtensions_DateDiffHour_Microsoft_EntityFrameworkCore_DbFunctions_System_DateTime_System_DateTime</a>_</p>
  <p>The issue now is that even though I have the Nuget EF Core 5 installed and imported in my class, I can not access any of the DbFunctions methods:</p>
  <p><a href="https://i.stack.imgur.com/dBLJ3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dBLJ3.png" alt="enter image description here" /></a></p>
  <p>The same applies to EF.Functions (no public methods):
  <a href="https://i.stack.imgur.com/RDxar.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RDxar.png" alt="enter image description here" /></a></p>
  <p>Is this perhaps a bug or am I not using these classes properly? Is this the right approach for what I want to accomplish?
  Cheers!</p>