我有這樣的對象:排序包含列表對象的列表每個排序依據
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