public ActionResult Delete(int id) { try { var check = postsRepository.FindPosts(id); if (check != null) { // TODO: Add delete logic here postsRepository.deletePost(id); return(RedirectToAction("Index")); } else { return(RedirectToAction("Index")); } } catch { return(View()); } }
public ActionResult PostContent(int id) { Posts post = postsRepository.FindPosts(id); return(View(post)); }