Ejemplo n.º 1
0
        public async Task <ActionResult <CommentResponse> > Create([FromBody] CommentCreateRequest comment)
        {
            var response = await CommentBusiness.Add((Comment)comment, User.Account());

            return(CreatedAtAction(nameof(Create), (CommentResponse)response));
        }
Ejemplo n.º 2
0
 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 }));
 }