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; } }
public Dictionary <Restaurant, int> GetResults() { return(Votes.GroupBy(x => x.Restaurant).ToDictionary(x => x.Key, x => x.Count())); }