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