Esempio n. 1
0
 public void Update(BookSaveDto bookDto)
 {
     var bookEntity = new BookEntity
     {
         Id = bookDto.Id,
         AuthorId = bookDto.AuthorId,
         CategoryId = bookDto.CategoryId,
         ISBN = bookDto.ISBN,
         Name = bookDto.Name,
         Price = bookDto.Price
     };
     this.bookRepository.Update(bookEntity);
 }
Esempio n. 2
0
        public void Update(BookSaveDto bookDto)
        {
            var bookEntity = new BookEntity
            {
                Id         = bookDto.Id,
                AuthorId   = bookDto.AuthorId,
                CategoryId = bookDto.CategoryId,
                ISBN       = bookDto.ISBN,
                Name       = bookDto.Name,
                Price      = bookDto.Price
            };

            this.bookRepository.Update(bookEntity);
        }
 public ActionResult Create(BookEditViewModel viewModel)
 {
     try
     {
         var bookDto = new BookSaveDto
         {
             Id = viewModel.Id,
             AuthorId = viewModel.AuthorId,
             Name = viewModel.Name,
             Price = viewModel.Price
         };
         this.booksUseCase.Create(bookDto);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }