public async Task <IActionResult> AddComment(string message, int productId) { var user = serviceUser.GetUser(); await commentRep.AddCommentAsync(message, productId, user.Id); return(RedirectToAction("Product", new { id = productId })); }
public async Task <ActionResult <Comment> > Comment(Comment comment) { await repo.AddCommentAsync(comment); await repo.SaveChangesAsync(); return(CreatedAtAction("GetComment", new { id = comment.ID }, comment)); }