我正在尝试使以下方法的签名生效。由于这是匿名类型,我遇到了一些麻烦,任何帮助都会很棒。
当我在 QuickWatch 窗口中查看 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();
}