This is a very short question and I fear the answer is short too.
Is there any way of doing anything along the lines of
Func<DataContext, string, bool, IEnumerable<X> fnMyQuery = CompiledQuery.Compile<DataContext, string, bool IList<X>(
(db, sortColumn, sortDesc) => (
(!sortDesc)?
db.OrderBy(x => DynamicResolve(sortColumn))
:
db.OrderByDescending(x => DynamicReolve(sortColumn))
));
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?