📅  最后修改于: 2022-03-11 14:57:22.789000             🧑  作者: Mango
var query=(from w in widgets
where w.Name.Contains("xyz")
select w);
var result = flag ?
query.OrderBy(w =>w) :
query.OrderByDescending(w = w);