public IActionResult Index(Post post) { pd.AddPost(post); pd.Commit(); //ViewBag.message = "Posted Successfully"; return(RedirectToAction("MyPost", "Post", new { Id })); // return View(); }
public IActionResult OnPostNewPost(Post post) { if (!ModelState.IsValid) { return(RedirectToPage()); } _postData.AddPost(post); return(RedirectToPage("Index")); }