List排序

简单的实现一个利用list排序的方法:

  this.CallHistoryList.Sort(CompareTo);
 public int CompareTo(CallHistory left, CallHistory other)
        {
            if (left.StartTime > other.StartTime)
            {
                return -1;
            }
            else if (left.StartTime == other.StartTime)
            {
                return 0;
            }
            else
            {
                return 1;
            }

        }
做个快乐的自己。
原文地址:https://www.cnblogs.com/Jessy/p/2320912.html