Exemplo n.º 1
0
        public async Task <IActionResult> Borrowed(int currentPage = 1)
        {
            var books = await this.books.BorrowedAsync(currentPage);

            var page = new PageViewModel
            {
                CurrentPage = currentPage,
                Area        = string.Empty,
                Controller  = nameof(BooksController),
                Action      = nameof(Borrowed),
                Count       = await this.books.GetBorrowedCountAsync()
            };

            var model = new BorrowedBooksListingViewModel
            {
                Page  = page,
                Books = books
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> MyBorrowedBooks(int currentPage = 1)
        {
            var userName = User.Identity.Name;

            var books = await this.books.MyBorrowedAsync(userName, currentPage);

            var page = new PageViewModel
            {
                CurrentPage = currentPage,
                Area        = string.Empty,
                Controller  = nameof(BooksController),
                Action      = nameof(MyBorrowedBooks),
                Count       = await this.books.GetMyBorrowedCountAsync(userName)
            };

            var model = new BorrowedBooksListingViewModel
            {
                Page  = page,
                Books = books
            };

            return(View(model));
        }