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)); }
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)); }