Exemplo n.º 1
0
        public ActionResult Cover(int id, HttpPostedFileBase uploadFile)
        {
            var fileName = $"BookId_{id}_{uploadFile.FileName}";
            var cover    = new CoverViewModel
            {
                Id       = id,
                FilePath = fileName,
                BookId   = id
            };

            var coverMap = _mapper.Map <CoverModel>(cover);

            _fileStorage.CreateCover(fileName, uploadFile.InputStream);
            _bookService.AddCover(id, coverMap);

            return(View("AddArchive", id));
        }