title: using Extension Method or Func in EF lambda expression
body: <p>I have an extension method that is fairly simple.
  When trying to use it in an Entity framework I get this</p>
  
  <pre><code>LINQ to Entities does not recognize the method 'Boolean Between[DateTime](System.DateTime, System.DateTime, System.DateTime, Boolean)' 
  </code></pre>
  
  <p>Many others are getting the same issue and I understand the error. There is always a way to make it work. </p>
  
  <p>I have been digging around trying to figure out how i can re-implement this method and have it be linq to EF friendly.</p>
  
  <p>for this specific method its just checking if one IComparable is between two others. so really it would just expand to </p>
  
  <pre><code>.Where(x=&gt; x.Date &gt;= startDate &amp;&amp; x.Date &lt;= endDate)
  </code></pre>
  
  <p>and all i am really trying to do is make it easier on the eyes and express it like</p>
  
  <pre><code>.Where(x=&gt; x.Date.Between(startDate, endDate))
  </code></pre>
  
  <p>Being that I am very new to the Func and such Im sure there is a way to approach extension methods (even if written specifically for EF) so that they will be friendly with EF linq</p>
  
  <p>I have done some digging around SO and other sites and come across some interesting answers but not able to get to past the finish line with them. </p>
  
  <p>Thanks in advance!</p>