Ejemplo n.º 1
0
        public async Task OnGetAsync()
        {
            SportokPagedList = mapper.Map <List <SportViewModel> >(await sportService.GetPaginatedSportListAsync(CurrentPage, PagerConstants.PageSize));
            SportokPagedList = SportHelper.SetSelectedSportsTrue(SportokPagedList, SelectedIds);

            Pagination.Count = await sportService.GetCountAsync();

            Pagination.TotalPages = (int)Math.Ceiling(decimal.Divide(Pagination.Count, PagerConstants.PageSize));
        }
Ejemplo n.º 2
0
        public async Task OnGetAsync()
        {
            if (SelectedIds == null)
            {
                SelectedIds = mapper.Map <List <int> >(await sportService.GetSportIdListToUserAsync((await userManager.FindByNameAsync(User.Identity.Name)).Id));
            }

            SportokPagedList = mapper.Map <List <SportViewModel> >(await sportService.GetPaginatedSportListAsync(CurrentPage, PagerConstants.PageSize));
            SportokPagedList = SportHelper.SetSelectedSportsTrue(SportokPagedList, SelectedIds);

            Pagination.Count = await sportService.GetCountAsync();

            Pagination.TotalPages = (int)Math.Ceiling(decimal.Divide(Pagination.Count, PagerConstants.PageSize));
        }