我正試圖在下面的方法上使用簽名。由於這是一個匿名類型,我有一些麻煩,任何幫助將是偉大的。簽名中的匿名類型
當我在一個快速監視窗口看着sortedGameList.ToList()我得到的簽名
System.Collections.Generic.List<<>f__AnonymousType0<System.DateTime,System.Linq.IGrouping<System.DateTime,DC.FootballLeague.Web.Models.Game>>>
非常感謝
唐納德
public List<IGrouping<DateTime, Game>> getGamesList(int leagueID)
{
var sortedGameList =
from g in Games
group g by g.Date into s
select new { Date = s.Key, Games = s };
return sortedGameList.ToList();
}
啊對,我沒有實際測試吧:) – leppie 2008-10-26 15:13:54