LINQ query needs either ascending or descending in the same query
- by Sir Psycho
Is there anyway this code can be refactored? The only difference is the order by part.
Idealy I'd like to use a delegate/lamda expression so the code is reusable but I don't know how to conditionally add and remove the query operators OrderBy and OrderByDescending
var linq = new NorthwindDataContext();
var query1 = linq.Customers
…