Exemple #1
0
 public IActionResult OnPost()
 {
     if (!ModelState.IsValid)
     {
         return(Page());
     }
     else
     {
         postData.Add(Post);
     }
     postData.Commit();
     TempData["Message"] = "Post Saved!";
     return(RedirectToPage("/Comment", new { postId = Post.Id }));
 }