title: How to use DateTime.AddDays(x) in Entity Framework
body: <p>I have this code:</p>
  
  <pre><code>from pr in e.ProgramSetup.Include("Program").Include("Program.Client")
          where pr.DateBegin &lt; DateTime.Now
          &amp;&amp; pr.DateEnd &gt; DateTime.Now.AddDays(pr.DateEndOffset) 
  select pr).ToList();
  </code></pre>
  
  <p>It does not work, because AddDays() is not possible to use for generating sql.</p>
  
  <p>So is there some another way? Now i select everything and filter it finaly by foreach, but it is not good way in my opinion.</p>
  
  <p>Problem is that pr.DateEndOffset is also only in db, it is not constant...</p>