how to sort List in c# / .net

前端 未结 4 1324
时光说笑
时光说笑 2021-01-11 10:25

I have a class PropertyDetails:

public class PropertyDetails
{

     public int Sequence { get; set; }

     public int Length { get; set; }

           


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 10:56

    Don't ever use non-generic collections in C# when you can use generics instead. There are a lot of reasons to use generic collections only (except for very special cases).

    See this question for more info: When would you not use Generic Collections?

    So you can use List (which I believe exposes a Sort() method) or SortedList<,>.

提交回复
热议问题