public ActionResult Index(string slug = "", int page = 0) { if (!string.IsNullOrEmpty(slug)) { var post = _nccPostService.GetBySlugs(slug); if (post == null) { return(Redirect(Constants.NotFoundUrl)); } return(View("Details", post)); } else { var allPost = _nccPostService.LoadAllByPostStatusAndDate(NccPost.NccPostStatus.Published, DateTime.Now); return(View(allPost)); } }