Beispiel #1
0
        public async Task <Dictionary <string, int> > GetWeddingCountByseat()
        {
            Dictionary <string, int> seatCount = new Dictionary <string, int>();
            var result = await _weddingRepository.GetAll();

            var seat = await _weddingRepository.GetSeatAsync();

            var seatList = seat.ToList();

            for (var i = 0; i < seatList.Count(); i++)
            {
                int count = result.Where(c => c.Seat.Equals(seatList[i])).Sum(c => c.Accompanied);
                seatCount.Add(seatList[i].ToString(), count);
            }

            return(seatCount);
        }