protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            while (!stoppingToken.IsCancellationRequested)
            {
                using var scope = _serviceProvider.CreateScope();

                var writeRepository     = scope.ServiceProvider.GetRequiredService <WriteMovieRepository>();
                var readMovieRepository = scope.ServiceProvider.GetRequiredService <ReadMovieRepository>();
                try
                {
                    await foreach (var item in _readModelChannel.ReturnValue(stoppingToken))
                    {
                        var movie = await writeRepository.GetMovieByIdAsync(item.MovieId, stoppingToken);

                        if (movie != null)
                        {
                            await readMovieRepository.AddAsync(new Movie
                            {
                                MovieId     = movie.Id,
                                Director    = movie.Director.FullName,
                                Name        = movie.Name,
                                PublishYear = movie.PublishYear,
                                BoxOffice   = movie.BoxOffice,
                                ImdbRate    = movie.ImdbRate
                            }, stoppingToken);
                        }
                    }
                }
                catch (Exception e)
                {
                    _logger.LogError(e, e.Message);
                }
            }
        }
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            while (!stoppingToken.IsCancellationRequested)
            {
                try
                {
                    using var scope = _serviceProvider.CreateScope();

                    var readMovieRepository = scope.ServiceProvider.GetRequiredService <ReadMovieRepository>();


                    await foreach (var item in _deleteModelChannel.ReturnValue(stoppingToken))
                    {
                        await readMovieRepository.DeleteByMovieIdAsync(item.MovieId, stoppingToken);
                    }
                }
                catch (Exception e)
                {
                    _logger.LogError(e, e.Message);
                }
            }
        }