예제 #1
0
        public async Task <IEnumerable <SeatDomainModel> > DeleteByAuditoriumId(int auditoriumId)
        {
            var seatModelsByAuditoriumId = _seatsRepository.GetByAuditoriumId(auditoriumId);

            if (seatModelsByAuditoriumId == null)
            {
                return(null);
            }
            seatModelsByAuditoriumId.ToList();

            var data = await _seatsRepository.DeleteByAuditoriumId(auditoriumId);

            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);
        }