public async Task <IActionResult> PostComment([FromBody] Comment comment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } data.AddComment(comment); data.commit(); return(CreatedAtAction("GetComment", new { id = comment.Id }, comment)); }
public IActionResult OnPost() { data.AddComment(comment); data.commit(); return(RedirectToPage("./Post")); }