In LINQ, is it possible to have conditional orderby sort order (ascending vs. descending).
Something like this (not valid code):
bool flag; (from w
You could try something like the following:
var q = from i in list where i.Name = "name" select i; if(foo) q = q.OrderBy(o=>o.Name); else q = q.OrderByDescending(o=>o.Name);