Exemple #1
0
        public async Task <bool> Handle(AddGenreCommand request, CancellationToken cancellationToken)
        {
            await _dbContext.GetDb();

            var genre = await _dbContext.GetGenre(request.Genre.Id);

            if (genre is not null)
            {
                return(false);
            }
            await _dbContext.AddGenre(request.Genre);

            return(true);
        }