If you just want an ordered List you can use this:
var assa = pq.OrderBy(p => p.Class1.Name).ToList();
If it is possible that Class1
property is null use this:
var assa = pq.Where(p => p.Class1 != null).OrderBy(p => p.Class1.Name).ToList();
If you want to have those objects where Class1
is null at the end of the resulting List
:
var assa = pq.Where(p => p.Class1 != null).OrderBy(p => p.Class1.Name).ToList();
assa.AddRange(pq.Where(p => p.Class1 == null));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…