-2

I need to sort a list based on a property (IsValid = true) with all true items on top and the rest below it.Since I'm using compact framework, I can't use OrderBy. Can anyone post me LINQ query to get the list ?

 List<Record> records = GetRecords();
4

1 回答 1

0

尝试这个:

records.OrderBy(rec => !rec.IsValid).OrderByDescending(re => re.Id);

于 2013-06-14T01:04:21.297 回答