Esempio n. 1
0
        public IActionResult Rented(string userId)
        {
            if (string.IsNullOrEmpty(userId))
            {
                return(RedirectToAction("Index"));
            }

            var user = _usersRepository.FindByUserId(userId);
            IEnumerable <BookItem> rentedBooks = _rentalService.FindRentedBooks(userId);
            var viewModel = new RentedViewModel
            {
                User        = user,
                RentedBooks = rentedBooks,
            };

            return(View(viewModel));
        }
Esempio n. 2
0
        public IActionResult Rented(string userId)
        {
            if (string.IsNullOrEmpty(userId))
            {
                return(RedirectToAction("Index"));
            }

            var user = _usersProvider.FindByUserId(userId);
            IEnumerable <InventoryItem> rentedBooks = _inventoryProvider.FindRentedItemsByUser(userId);
            var viewModel = new RentedViewModel
            {
                User        = user,
                RentedItems = rentedBooks,
            };

            return(View(viewModel));
        }