public IActionResult GetComments(int id, int skip, int take) { var tenant = Util.Util.GetSubdomain(HttpContext.Request.Host.ToString()); User user = _usermanager.GetUserAsync(User).Result; IEnumerable <Comment> comments = _ideationManager.GetComments(id, skip, take); List <CommentDTO> commentDtos = new List <CommentDTO>(); foreach (Comment comment in comments) { Report report = null; if (user != null) { report = comment.Reports.Find(r => r.User.Id == user.Id); } CommentDTO commentDto = new CommentDTO() { CommentId = comment.CommentId, CommentText = comment.CommentText, DateTime = comment.Created.FormatParasableDate(), UserDisplayName = comment.User.GetDisplayName(), UserName = comment.User.UserName, ReportedByMe = (report != null) }; if (_usermanager.IsUserAdminOrAbove(comment.User, tenant)) { commentDto.UserDisplayName = comment.User.GetFullName(); } if ((user != null && _usermanager.IsUserModOrAbove(user, tenant)) || _usermanager.IsUserOrganisation(comment.User)) { //Mods can see the full name commentDto.UserFullName = comment.User.GetFullName(); commentDto.UserDisplayName = comment.User.GetFullName(); } commentDtos.Add(commentDto); } return(Ok(commentDtos)); }