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)); }
public List <ShowTime> GetAllPublished() { return(repository.FindWhere(s => s.Status == ShowTime.ShowState.PUBLISHED)); }