title: LINQ CompiledQuery.Compile and dynamic sorting?
body: <p>This is a very short question and I fear the answer is short too.</p>
  
  <p>Is there any way of doing anything along the lines of</p>
  
  <pre><code>Func&lt;DataContext, string, bool, IEnumerable&lt;X&gt; fnMyQuery = CompiledQuery.Compile&lt;DataContext, string, bool IList&lt;X&gt;(
       (db, sortColumn, sortDesc) =&gt; (
            (!sortDesc)?
                db.OrderBy(x =&gt; DynamicResolve(sortColumn))
            :
                db.OrderByDescending(x =&gt; DynamicReolve(sortColumn))
        ));
  </code></pre>
  
  <p>Said in another way, I'd like to create a compiled query that can take in a column and a sort order and then sort my results in the so desired way - I can work out how to do this without having the query compiled - but is it possible with a compiled query using LINQ to SQL?</p>