Beispiel #1
0
 public void Reveal()
 {
     if (Votes != null && Votes.Any())
     {
         WonBy = Votes.GroupBy(i => i)
                 .Select(i => new { PlayerId = i.Key, Count = i.Count() })
                 .OrderByDescending(i => i.Count)?
                 .FirstOrDefault()?.PlayerId ?? 0;
     }
 }
Beispiel #2
0
 public Dictionary <Restaurant, int> GetResults()
 {
     return(Votes.GroupBy(x => x.Restaurant).ToDictionary(x => x.Key, x => x.Count()));
 }