public ActionResult EditPost(int id) { var read = new FITlosophiOperations(); var postToEdit = read.GetPostByID(id); return View(postToEdit); }
public Post GetPostByID(int PostID) { var read = new FITlosophiOperations(); return read.GetPostByID(PostID); }
public ActionResult BlogDetail(int postID) { var blogDetailVM = new BlogDetailViewModel(); var ops = new FITlosophiOperations(); blogDetailVM.UserSelectedPost = ops.GetPostByID(postID); blogDetailVM.Categories = ops.GetAllCategories(); var readMorePosts = ops.GetPostsByAmount(10); blogDetailVM.Posts = readMorePosts.Where(p => p.PostID != postID).ToList(); return View(blogDetailVM); }