title: LINQ DateTimeOffset expression could not be translated
body: <p>I have Order.cs class that contains a property:</p>
  <pre><code>public string OrderDate { get; set; } = DateTimeOffset.Now.ToString();
  </code></pre>
  <p>I have Order dbset. Using EF I want to get all the Orders from last 30 days. I wrote this code:</p>
  <pre><code>var now = DateTimeOffset.Now;
   var orders = _context.Orders.Where(o =&gt; ((now - DateTimeOffset.Parse(o.OrderDate)).TotalDays &lt; 30)).ToList();
  </code></pre>
  <p>I get following error:</p>
  <pre><code>System.InvalidOperationException: The LINQ expression 'DbSet&lt;Order&gt;
  .Where(o =&gt; (__now_0 - DateTimeOffset.Parse(o.OrderDate)).TotalDays &lt; 30)' 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>Any suggestions how to fix this?</p>
  <p>EDIT</p>
  <p>I changed the OrderDate property to</p>
  <pre><code>public DateTime OrderDate { get; set; } = DateTime.Now;
  </code></pre>
  <p>And the LINQ query to following:</p>
  <pre><code>var atm = DateTime.Now;
   var orders = _context.Orders.Where(o =&gt; (o.OrderDate - atm).TotalDays &lt; 30);
  </code></pre>
  <p>I still get the same error.</p>