public ActionResult Index() { //ViewBag.CatNames = TempData["GetCatNames"]; ////ViewBag.CatNames = "apple"; var m = new CategoryPostModel(); m.CatList = repCategory.Read().ToList(); m.PostList = repPost.Read().ToList(); m.TopicList = repTopic.Read().ToList(); // Top = repTopic.Read().ToList(); return(View(m)); }
public ActionResult Index(int id, int page = 1) { ViewBag.Items = 10; ViewBag.Page = page; int start = (page - 1) * ViewBag.Items; int stop = start + ViewBag.Items; TopicModel topic = repository.Read(id, start, stop); if (topic == null) { throw new HttpException(404, "Topic could not be found."); } topic.Id = id; return(View(topic)); }
// GET: Topics public ActionResult Index() { var tp = new TopicPostViewModel(); tp.TopicList = repTopic.Read().ToList(); tp.PostList = repPost.Read().ToList(); return(View(tp)); }