예제 #1
0
        public Theater Delete(int id)
        {
            bool isShowTimeCreated = showTimeRepository.FindWhere(s => s.TheaterId == id).Any();

            if (isShowTimeCreated)
            {
                throw new Exception("Không thể xóa phòng chiếu đã tạo lịch");
            }

            var existed = GetDetail(id);

            if (existed.Rooms.Any())
            {
                throw new Exception("Can not delete Theater that already had Rooms");
            }

            return(repository.Delete(id));
        }
예제 #2
0
 public async Task Delete(string id)
 {
     await TheaterRepository.Delete(id);
 }