标签:
public class User
{
public int Id { get; set; }
public string Code { get; set; }
}
//示例
//升序
list.Sort(delegate(User v1, User v2)
{
return v1.Code.CompareTo(v2.Code);
});
//降序
//list.Sort(delegate(User v1, User v2)
//{
// return v2.Code.CompareTo(v1.Code);
//});
标签:
原文地址:http://www.cnblogs.com/ylemzhang/p/4305866.html