Example #1
0
        public async Task OnGetAsync()
        {
            IQueryable <TouroperatorCompany> touroperatorCompanyIQ = _context.TouroperatorCompanies
                                                                     .Include(tc => tc.TouroperatorBrands).ThenInclude(tb => tb.TouroperatorBrand);

            touroperatorCompanyIQ = TouroperatorCompanyFilter.Process(touroperatorCompanyIQ);
            touroperatorCompanyIQ = TouroperatorCompanySort.Process(touroperatorCompanyIQ);
            touroperatorCompanyIQ = TouroperatorCompanyPaginate.Process(touroperatorCompanyIQ, TouroperatorCompanyPageSize);

            TouroperatorCompany = await touroperatorCompanyIQ.AsNoTracking().ToListAsync();

            ViewData["FilterTouroperatorBrandId"] = new SelectList(_context.TouroperatorBrands.OrderBy(tb => tb.Name).AsNoTracking(), "Id", "Name");
            ViewData["PageSize"]        = new SelectList(TouroperatorCompanyPaginate.PageSizeDictionary, "Key", "Value", TouroperatorCompanyPaginate.PageSize);
            TouroperatorCompanyPageSize = TouroperatorCompanyPaginate.PageSize;
            TempData.Keep("TouroperatorCompanyPageSize");
        }
Example #2
0
        public async Task OnGetAsync(Guid touroperatorBrandId)
        {
            IQueryable <TouroperatorCompany> touroperatorCompanyIQ = _context.TouroperatorCompanies
                                                                     .Include(tc => tc.TouroperatorBrands).ThenInclude(tb => tb.TouroperatorBrand);

            touroperatorCompanyIQ = TouroperatorCompanyFilter.Process(touroperatorCompanyIQ);
            touroperatorCompanyIQ = TouroperatorCompanySort.Process(touroperatorCompanyIQ);
            touroperatorCompanyIQ = TouroperatorCompanyPaginate.Process(touroperatorCompanyIQ, TouroperatorCompanyPageSize);

            TouroperatorCompany = await touroperatorCompanyIQ.AsNoTracking().ToListAsync();

            if (!Guid.Equals(touroperatorBrandId, Guid.Empty))
            {
                TouroperatorBrand = await _context.TouroperatorBrands.FindAsync(touroperatorBrandId);
            }

            ViewData["PageSize"]        = new SelectList(TouroperatorCompanyPaginate.PageSizeDictionary, "Key", "Value", TouroperatorCompanyPaginate.PageSize);
            TouroperatorCompanyPageSize = TouroperatorCompanyPaginate.PageSize;
            TempData.Keep("TouroperatorCompanyPageSize");
        }