public IActionResult OnGet(string Content, int messageId) { if (Content != null) { Comment comment = new Comment(); comment.Content = Content; comment.MessageId = messageId; MessageBoard.AddComment(comment); TempData["Msg"] = "Comment saved!"; return(RedirectToPage("./Timeline")); } return(Page()); }
public async Task <ActionResult <int> > AddComment(string comment) { return(await MessageBoard.AddComment(comment)); }