Exemplo n.º 1
0
        public async Task <ActionResult> AddReply(PostReplyModel model)
        {
            var userId = User.Identity.GetUserId();
            var user   = _userManager.FindByIdAsync(userId).Result;
            var reply  = BuildReply(model, user);

            await _postRepositories.AddPostReply(reply);

            await _applicationUserRepositories.IncrementUserRating(user.Id, typeof(PostReply));

            return(RedirectToAction("Index", "Post", new { id = model.PostId }));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> AddReply(PostReplyModel model)
        {
            var userId = _userManager.GetUserId(User);
            var user   = await _userManager.FindByIdAsync(userId);

            var reply = BuildReply(model, user);

            await _postService.AddPostReply(reply);

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

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