public List <Player> getYellowCardsForAllPlayer()
        {
            var players = GetCollections.getPlayerCollection();
            var yCards  = GetCollections.getYellowCardCollection();

            return((players.Select(p => { p.yellowCards = yCards.Count(b => b.playerId == p.Id); return p; })).OrderByDescending(pp => pp.yellowCards).ToList());
        }
示例#2
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     List <Player> yellowCardsPlayersDescending2 = (GetCollections.getPlayerCollection().Select(p => { p.yellowCards = GetCollections.getYellowCardCollection().Count(b => b.playerId == p.Id); return(p); })).OrderByDescending(pp => pp.yellowCards).ToList();
 }