title: C# LINQ to Entities does not recognize the method 'Boolean'
body: <p>I have the following linq expression in lambda syntax:</p>
  
  <pre><code>var myValue = 6;
  var from = 2;
  var to = 8;
  
  var res = MyList.Where(m =&gt; m.person.Id == person.Id
                           &amp;&amp; IsBetween(myValue, from, to))
                  .Select(x =&gt; new Person { blah blah blah })
                  .ToList());
  </code></pre>
  
  <p>IsBetween is simple generic helper method to see whether I have something in between:</p>
  
  <pre><code>public bool IsBetween&lt;T&gt;(T element, T start, T end)
  {
      return Comparer&lt;T&gt;.Default.Compare(element, start) &gt;= 0
          &amp;&amp; Comparer&lt;T&gt;.Default.Compare(element, end) &lt;= 0;
  }
  </code></pre>
  
  <p>Now I get this error, and I don't know hot to get around it:</p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'Boolean IsBetween[Decimal](System.Decimal, System.Decimal, System.Decimal)' method, and this method cannot be translated into a store expression.</p>
  </blockquote>