public IActionResult OnGet(int id, string CommentText) { if (CommentText != null) { comment = new Comment(); comment.MessageId = id; comment.CommentText = CommentText; messageBoardData.AddComment(comment); return(RedirectToPage("./MessageList")); } return(Page()); }
public async Task <ActionResult <int> > addComment(string str) { return(await MessageBoardData.AddComment(str)); }