Exemple #1
0
        public async Task <string> Handle(UpdateCoverImageCommand request, CancellationToken cancellationToken)
        {
            var    file                 = request.File;
            string fileName             = file.FileName;
            string extension            = Path.GetExtension(fileName);
            string coverPictureLocation = await _handler.CreateCoverPicturePath(request.MangaId, extension);

            _handler.SaveFileToLocation(request.File, coverPictureLocation);

            coverPictureLocation = RemoveRootFolder(coverPictureLocation);

            await _repo.UpdateCoverPictureLocation(coverPictureLocation, request.MangaId, cancellationToken);

            return(coverPictureLocation);
        }