public async Task <IEnumerable <ProjectionDomainModel> > DeleteByMovieId(Guid movieId) { var projectionModelsByMovieId = _projectionsRepository.GetByMovieId(movieId).ToList(); foreach (Projection projection in projectionModelsByMovieId) { var deletedReservations = await _reservationService.DeleteByProjectionId(projection.Id); if (deletedReservations == null) { return(null); } } var deletedProjections = await _projectionsRepository.DeleteByMovieId(movieId); if (deletedProjections == null) { return(null); } List <ProjectionDomainModel> domainModelList = new List <ProjectionDomainModel>(); foreach (Projection projection in deletedProjections) { ProjectionDomainModel domainModel = new ProjectionDomainModel { Id = projection.Id, AuditoriumId = projection.AuditoriumId, MovieId = projection.MovieId, ProjectionTime = projection.DateTime }; domainModelList.Add(domainModel); } return(domainModelList); }