我正试图在下面的方法上使用签名。由于这是一个匿名类型,我有一些麻烦,任何帮助将是伟大的。签名中的匿名类型
当我在一个快速监视窗口看着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