Example #1
0
        public async Task <IActionResult> Index(SortFilterPageOptionsNoCount options, [FromServices] IListBooksCachedNoCountService service)
        {
            var bookList = await service.SortFilterPage(options)
                           .ToListAsync();

            options.SetupRestOfDto(bookList.Count);
            SetupTraceInfo();

            return(View(new BookListNoCountCombinedDto(options, bookList)));
        }
Example #2
0
        public async Task <IActionResult> Index(SortFilterPageOptionsNoCount options, [FromServices] BookDbContext context)
        {
            var bookList = (await context.DapperBookListQueryAsync(options)).ToList();

            options.SetupRestOfDto(bookList.Count);

            SetupTraceInfo();

            return(View(new BookListNoCountCombinedDto(options, bookList)));
        }
Example #3
0
        public async Task <IList <CosmosBook> > SortFilterPageAsync(SortFilterPageOptionsNoCount options)
        {
            var booksFound = await _context.Books
                             .AsNoTracking()
                             .OrderBooksBy(options.OrderByOptions)
                             .FilterBooksBy(options.FilterBy,
                                            options.FilterValue)
                             .Page(options.PageNum - 1, options.PageSize)
                             .ToListAsync();

            options.SetupRestOfDto(booksFound.Count);

            var x = _context.ChangeTracker;

            return(booksFound);
        }