public async Task <LstNewsModel> GetListContentNewsisHome(int pageSize, int pageIndex) { var lstNews = new LstNewsModel(); var listTransactionHistory = await _newsManager.GetListContentNewsisHome(pageSize, pageIndex); // var allTransactionHistory = await _newsManager.GetTotalContentNews(status); lstNews.LstNews = _mapper.Map <List <ContentNews>, List <ContentNewsModel> >(listTransactionHistory); // lstNews.TotalCount = allTransactionHistory; return(lstNews); }
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; } }