Ejemplo 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);
 }
Ejemplo 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);
        }
Ejemplo n.º 3
0
 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();
     }
 }