public async Task <AddMovieCommandResult> Handle(AddMovieCommand request, CancellationToken cancellationToken)
        {
            var director = await _directorRepository.GetDirectorAsync(request.Director, cancellationToken);

            if (director is null)
            {
                director = new Director {
                    FullName = request.Director
                };
                await _directorRepository.AddDirectorAsync(director, cancellationToken);
            }

            var movie = new Movie
            {
                PublishYear = request.PublishYear,
                BoxOffice   = request.BoxOffice,
                ImdbRate    = request.ImdbRate,
                Name        = request.Name,
                Director    = director
            };

            await _movieRepository.AddMovieAsync(movie, cancellationToken);

            await _db.SaveChangesAsync(cancellationToken);

            await _channel.AddToChannelAsync(new MovieAdded { MovieId = movie.Id }, cancellationToken);

            return(new AddMovieCommandResult {
                MovieId = movie.Id
            });
        }
        public async Task <bool> Handle(DeleteMovieCommand request, CancellationToken cancellationToken)
        {
            var movie = await _writeMovieRepository.GetMovieByIdAsync(request.MovieId, cancellationToken);

            if (movie is null)
            {
                return(false);
            }

            _writeMovieRepository.DeleteMovie(movie);

            await _db.SaveChangesAsync(cancellationToken);

            await _channelQueue.AddToChannelAsync(new MovieDeleted { MovieId = request.MovieId }, cancellationToken);


            return(true);
        }