Ejemplo n.º 1
0
        public async Task <IActionResult> AddNewPostReply(PostReplyModel model)
        {
            var userId = _userManager.GetUserId(User);
            var user   = await _userManager.FindByIdAsync(userId);

            var reply = BuildReply(user, model);

            await _postService.AddNewPostReply(reply);

            await _userService.UpdateUserRating(userId, typeof(PostReply));

            return(RedirectToAction("Index", "Post", new { postId = model.PostId }));
        }