title: How to implement the equivalent functionality to a custom IComparer for Linq to Entities OrderBy()?
body: <p>How can I implement the equivalent to a custom IComparer for Linq to Entities OrderBy()?</p>
  
  <p>A custom comparer is not supported in Linq to Entities as <a href="http://msdn.microsoft.com/en-us/library/bb738624.aspx" rel="nofollow">MSDN documentation states</a>:</p>
  
  <blockquote>
    <p>Most of the LINQ ordering methods are supported in LINQ to Entities, with the exception of those that accept an <a href="http://msdn.microsoft.com/en-us/library/8ehhxeaf.aspx" rel="nofollow"><code>IComparer</code></a>, because the comparer cannot be translated to the data source. For more information, see <a href="http://msdn.microsoft.com/en-us/library/bb738551.aspx" rel="nofollow">Standard Query Operators in LINQ to Entities Queries</a>.</p>
  </blockquote>