我有这样的对象:排序包含列表对象的列表每个排序依据
public class humanInfo
{
public string m_Name { get;set; }
public List<HumanAttributes> m_ListHumanAttributes { get; set;}
}
我想基础上,Age
属性,它位于每个人的属性列表进行排序这个列表。
humanList = humanList.OrderBy(/*How am I gonna do this?*/);
我试图达到使用x => x.m_ListHumanAttributes.All()
,例如所有项目,但我是一个有点无能,我怎么可能会继续。任何人都有一个好主意?
编辑
这里有一个想法HumanAttributes
类可能是如何工作的:
public class HumanAttributes
{
public int m_HumanAttributesID {get;set;}
public Sex m_HumanAttributeSex {get;set;}
public int m_HumanAge {get;set;}
public decimal m_HumanHeight {get;set;}
}
我们可以看看'HumanAttributes '? – 2013-04-30 19:52:56
也许'x => x.Age'? – Tim 2013-04-30 19:54:13