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());
        }
        public static ObjectId getPlayerId(string firstNamePlayer, string lastName)
        {
            var players = GetCollections.getPlayerCollection();

            return((players.First(e => e.firstName == firstNamePlayer && e.lastName == lastName)).Id);
        }
Пример #3
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();
 }