Beispiel #1
0
        public async Task <IEnumerable <SeatDomainModel> > GetSeatsByAuditoriumId(int id)
        {
            var data = _seatsRepository.GetByAuditoriumId(id);

            if (data == null)
            {
                return(null);
            }

            List <SeatDomainModel> domainModelList = new List <SeatDomainModel>();

            foreach (Seat seat in data)
            {
                SeatDomainModel domainModel = new SeatDomainModel
                {
                    Id           = seat.Id,
                    AuditoriumId = seat.AuditoriumId,
                    Number       = seat.Number,
                    Row          = seat.Row
                };

                domainModelList.Add(domainModel);
            }

            return(domainModelList);
        }