public async Task <IActionResult> GetAsync( [FromQuery] int?p = 1, [FromQuery] string filter = "") { if (p == null || p <= 0) { p = 1; } ViewBag.p = p.Value; if (filter.IsNullOrEmpty()) { return(PartialView(TableView, new PagedResultDto <VocabularySearchResultDTO>(0, new List <VocabularySearchResultDTO>()))); } var serchInp = new GetSearchVocabularyDTO { Filter = filter ?? "", MaxResultCount = AppTheme.Limit, SkipCount = (p.Value - 1) * AppTheme.Limit, }; var res = await _VocabularyService.GetVocabSearchRes(serchInp); if (res.Success) { PagedResultDto <VocabularySearchResultDTO> Containers = res.Data; string listRes = string.Format("Showing {0} to {1} of {2} entries", res.Data.TotalCount > 0 ? serchInp.SkipCount + 1 : 0, serchInp.SkipCount + res.Data.Items.Count, res.Data.TotalCount); if (!filter.IsNullOrEmpty()) { listRes += string.Format(" for \"{0}\"", serchInp.Filter); } ViewBag.ListState = listRes; ViewBag.Filter = filter; ViewBag.Pagination = PaginateHelper.Generate( "javascript:syncVt('{0}', '" + filter + "');", p.Value, Containers.TotalCount, AppTheme.Limit); return(PartialView(TableView, Containers)); } else { return(PartialView(AppTheme.ContentNothing)); } }