private async Task SeedMoviesToSee(CancellationToken cancellationToken)
        {
            logger.LogInformation("Seeding movies to see ...");

            foreach (var movie in DataForSeeding.MoviesToSee)
            {
                await moviesToSeeRepository.AddMovie(movie, cancellationToken);
            }
        }
Beispiel #2
0
        public async Task <MovieId> AddMovie(MovieInfoModel movieInfo, CancellationToken cancellationToken)
        {
            logger.LogInformation("Adding movie to see '{SourceMovieUri}' ...", movieInfo.MovieUri);

            var movieToSee = new MovieToSeeModel
            {
                TimestampOfAddingToSeeList = clock.Now,
                MovieInfo = movieInfo,
            };

            return(await repository.AddMovie(movieToSee, cancellationToken));
        }
        public async Task MoveToMoviesToSee(MovieId movieId, CancellationToken cancellationToken)
        {
            logger.LogInformation("Moving movie {MovieId} to movies to see ...", movieId);

            var movieToGet = await moviesToGetRepository.GetMovie(movieId, cancellationToken);

            var movieToSee = new MovieToSeeModel
            {
                TimestampOfAddingToSeeList = clock.Now,
                MovieInfo = movieToGet.MovieInfo,
            };

            await moviesToSeeRepository.AddMovie(movieToSee, cancellationToken);

            await moviesToGetRepository.DeleteMovie(movieId, cancellationToken);
        }