Ejemplo n.º 1
0
        public IActionResult LendBook(LendviewModel lendviewModel)
        {
            var book = _bookRepository.GetById(lendviewModel.Book.BookId);

            var customer = _customerRepository.GetById(lendviewModel.Book.BorrowerId);

            book.Customer = customer;

            //redirect to the list view
            return(RedirectToAction("List"));
        }
Ejemplo n.º 2
0
        public IActionResult LendBook(int bookId)
        {
            //load current book and all customers
            var lendVM = new LendviewModel()
            {
                Book      = _bookRepository.GetById(bookId),
                Customers = _customerRepository.GetAll()
            };

            //send data to th elend view
            return(View(lendVM));
        }