public async Task <ActionResult <CommentResponse> > Create([FromBody] CommentCreateRequest comment) { var response = await CommentBusiness.Add((Comment)comment, User.Account()); return(CreatedAtAction(nameof(Create), (CommentResponse)response)); }
public ActionResult Create([Bind(Include = "Id,PasteId,Content")] Comment comment) { comment.Author = User.Identity.Name; dbComments.Add(comment); return(RedirectToAction("Details", "Home", new { id = comment.PasteId })); }