C# List 排序

写一个sorter

public class CourseSorter:IComparer
{
  #region IComparer Members
  public int Compare(CourseDto x, CourseDto y)
  {
    return x.Title.CompareTo(y.Title);
  }
  #endregion
}

用的时候list.sort(new Sorter());即可

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注