C# list sort by two columns

前端 未结 7 1105
慢半拍i
慢半拍i 2020-12-15 21:08

I have a C# custom object list that I need to sort by two different variables one is a boolean and the other is a string. I can sort by either of the criteria, but

7条回答
  •  执笔经年
    2020-12-15 21:49

    var sortResult = result.OrderBy(a => a.CheckedIn).ThenBy(a => a.LastName).ToList();
    

提交回复
热议问题