public IActionResult LikeResponse(int ResponseId, int PostId) { var response = _responseService.GetResponse(ResponseId); var user = _userService.GetUser(User.Identity.Name); if (_responseService.CheckIfUserLikedResponse(response, user)) { return(RedirectToAction("Post", "Home", new { id = PostId })); } var post = _postService.GetPost(PostId); var newLike = new ResponseLike(); newLike.Response = response; newLike.User = user; newLike = _responseLikeService.AddWithCommit(newLike); _responseService.AddLike(newLike.Response, newLike); var newNotification = new Notification { NotifiedUser = response.User, NotifyingUser = user, NotificationType = NotificationType.LikeResponse, Post = post }; _notificationService.AddNotification(newNotification); _ccDbContextService.Commit(); return(RedirectToAction("Post", "Home", new { id = PostId })); }