Exemplo n.º 1
0
 public async Task<IActionResult> Latest(int p = 1)
 {
     if (p <= 0) p = 1;
     var data = new PostData(Db);
     var model = await data.LatestAsync(p);
     if (model == null) Redirect("/");
     ViewBag.PageCount = data.PageCount;
     ViewBag.PageNo = p;
     ViewBag.PagingUrl = "/Latest/{p}";
     return View("Index",model);
 }