public async Task <IActionResult> List(int pageSize = 10, int pageIndex = 1) { var size = pageSize > 0 ? pageSize : _configuration.GetValue <int>("PagingConfig:PageSize"); var page = pageIndex > 0 ? pageIndex : 1; var transactionHistoryModel = await _newsService.GetListContentNewsPaging(size, page, 0); transactionHistoryModel.PageIndex = page; transactionHistoryModel.PageSize = size; return(View(transactionHistoryModel)); }
public async Task <IActionResult> ListNews() { try { //if (!_userService.IsSignedIn(User)) //{ // return RedirectToAction(nameof(HomeController.Index), "Home"); //} //get contact from db LstNewsModel model = new LstNewsModel(); model = await _newsService.GetListContentNewsPaging(10, 1, 1); return(View(model)); // return View("~/Views/Support/Contact.cshtml", contact); } catch (Exception ex) { throw ex; } }