public override async Task GetPageData(int pageIndex) { try { var r = await menuService.GetMenuListAsync(new QueryParameters() { PageIndex = pageIndex, PageSize = PageSize, Search = SearchText }); if (r != null && r.success) { GridModelList = new ObservableCollection <Menu>(); this.TotalCount = r.dynamicObj.TotalCount; r.dynamicObj.Items?.ToList().ForEach(arg => { GridModelList.Add(arg); }); base.SetPageCount(); } } catch (Exception ex) { Log.Error(ex.Message); } }
public override async Task GetPageData(int pageIndex) { try { var r = await menuService.GetMenuListAsync(new QueryParameters() { PageIndex = pageIndex, PageSize = PageSize, Search = SearchText }); if (r != null && r.success) { GridModelList = new ObservableCollection <Menu>(); var pagedList = JsonConvert.DeserializeObject <PagedList <Menu> >(r.dynamicObj?.ToString()); this.TotalCount = pagedList.TotalCount; pagedList.Items?.ToList().ForEach(arg => { GridModelList.Add(arg); }); base.SetPageCount(); } } catch (Exception ex) { //.. } }