Esempio n. 1
0
        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 }));
        }
Esempio n. 2
0
        public async Task <ActionResult <Comment> > Comment(Comment comment)
        {
            await repo.AddCommentAsync(comment);

            await repo.SaveChangesAsync();

            return(CreatedAtAction("GetComment", new { id = comment.ID }, comment));
        }