public ActionResult AllPosts() { BL_Posts bL_Posts = new BL_Posts(); List <Post> posts_List = bL_Posts.Posts.ToList(); return(View(posts_List)); }
public ActionResult Delete(int id) { BL_Posts bL_Posts = new BL_Posts(); bL_Posts.DeletePost(id); return(RedirectToAction("AllPosts")); }
public ActionResult Create(Post post) { if (ModelState.IsValid) { BL_Posts bL_Posts = new BL_Posts(); bL_Posts.InsertPost(post); return(RedirectToAction("AllPosts")); } return(View()); }