Thursday, August 8, 2013

Sort a List of T in C#.

using System;
using System.Collections.Generic;
using AntMill.Core.Objects;
namespace AntMill.Core.Utilities
{
   public class DataTransferObjectSorter
   {
      public List<DataTransferObject> Sort(List<DataTransferObject> list)
      {
         list.Sort((a, b) => String.Compare(a.FriendlyName, b.FriendlyName));
         return list;
      }
   }
}

No comments:

Post a Comment