Ejemplo n.º 1
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));
        }