public IdeaExtendedData(
     string authorName,
     string authorEmail,
     string ideaForumPartialUrl,
     string ideaForumTitle,
     IdeaForumCommentPolicy ideaForumCommentPolicy,
     IdeaForumVotingPolicy ideaForumVotingPolicy,
     IdeaForumVotingType ideaForumVotingType,
     int ideaForumVotesPerIdea,
     int?ideaForumVotesPerUser)
 {
     AuthorName             = authorName;
     AuthorEmail            = authorEmail;
     IdeaForumPartialUrl    = ideaForumPartialUrl;
     IdeaForumTitle         = ideaForumTitle;
     IdeaForumCommentPolicy = ideaForumCommentPolicy;
     IdeaForumVotingPolicy  = ideaForumVotingPolicy;
     IdeaForumVotingType    = ideaForumVotingType;
     IdeaForumVotesPerIdea  = ideaForumVotesPerIdea;
     IdeaForumVotesPerUser  = ideaForumVotesPerUser;
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="entity">An adx_idea entity.</param>
        /// <param name="httpContext"></param>
        /// <param name="commentCount">The number of comments for this idea.</param>
        /// <param name="authorName">The name of the author for this idea.</param>
        /// <param name="authorEmail">The email of the author for this idea.</param>
        /// <param name="ideaForumPartialUrl">The URL slug for the parent idea forum of this idea.</param>
        /// <param name="ideaForumTitle">The title for the parent idea forum of this idea.</param>
        /// <param name="commentPolicy">The comment policy for this idea.</param>
        /// <param name="votingPolicy">The voting policy for this idea.</param>
        /// <param name="votingType">The type of voting (up, up or down, or rating).</param>
        /// <param name="votesPerIdea">The number of votes a user can use on this idea.</param>
        /// <param name="votesPerUser">The number of votes a user can use in the parent idea forum.</param>
        /// <param name="voteUpCount">The number of positive votes this idea has.</param>
        /// <param name="voteDownCount">The number of negative votes this idea has.</param>
        /// <param name="voterCount">The number of users that have voted for this idea.</param>
        /// <param name="currentUserIdeaForumActiveVoteCount">The number of votes casted by the current user in the parent idea forum.</param>
        /// <param name="currentUserIdeaVoteCount">The number of votes casted by the current user for this idea.</param>
        public Idea(
            Entity entity,
            HttpContextBase httpContext,
            int commentCount,
            string authorName,
            string authorEmail,
            string ideaForumPartialUrl,
            string ideaForumTitle,
            IdeaForumCommentPolicy commentPolicy,
            IdeaForumVotingPolicy votingPolicy,
            IdeaForumVotingType votingType,
            int votesPerIdea,
            int?votesPerUser,
            int voteUpCount,
            int voteDownCount,
            int voterCount,
            int currentUserIdeaForumActiveVoteCount,
            int currentUserIdeaVoteCount)
        {
            entity.ThrowOnNull("entity");
            entity.AssertEntityName("adx_idea");
            httpContext.ThrowOnNull("httpContext");
            ThrowOnNegative(commentCount, "commentCount");
            ThrowOnNegative(votesPerIdea, "votesPerIdea");
            ThrowOnNegative(voteUpCount, "voteUpCount");
            ThrowOnNegative(voteDownCount, "voteDownCount");
            ThrowOnNegative(currentUserIdeaForumActiveVoteCount, "currentUserIdeaForumActiveVoteCount");
            ThrowOnNegative(currentUserIdeaVoteCount, "currentUserIdeaVoteCount");

            Entity              = entity;
            _httpContext        = httpContext;
            AuthorName          = authorName;
            AuthorEmail         = authorEmail;
            AuthorId            = entity.GetAttributeValue <EntityReference>("adx_authorid") == null ? Guid.Empty : entity.GetAttributeValue <EntityReference>("adx_authorid").Id;
            CommentCount        = commentCount;
            CommentPolicy       = commentPolicy;
            Copy                = entity.GetAttributeValue <string>("adx_copy");
            Id                  = entity.Id;
            IdeaForumPartialUrl = ideaForumPartialUrl;
            IdeaForumTitle      = ideaForumTitle;
            IsApproved          = entity.GetAttributeValue <bool?>("adx_approved").GetValueOrDefault(false);
            PartialUrl          = entity.GetAttributeValue <string>("adx_partialurl");
            Status              = entity.GetAttributeValue <OptionSetValue>("statuscode") == null ? (int)IdeaStatusCode.Inactive : entity.GetAttributeValue <OptionSetValue>("statuscode").Value;
            StatusDisplayName   = entity.FormattedValues["statuscode"] == null ? string.Empty : entity.FormattedValues["statuscode"].ToString();
            StatusComment       = entity.GetAttributeValue <string>("adx_statuscomment");
            SubmittedOn         = entity.GetAttributeValue <DateTime?>("adx_date") ?? entity.GetAttributeValue <DateTime>("createdon");
            Summary             = entity.GetAttributeValue <string>("adx_summary");
            Title               = entity.GetAttributeValue <string>("adx_name");
            VoteUpCount         = voteUpCount;
            VoteDownCount       = voteDownCount;
            VoterCount          = voterCount;
            VotesPerIdea        = votesPerIdea;
            VotesPerUser        = votesPerUser;
            VotingPolicy        = votingPolicy;
            VotingType          = votingType;
            CurrentUserIdeaForumActiveVoteCount = currentUserIdeaForumActiveVoteCount;
            CurrentUserIdeaVoteCount            = currentUserIdeaVoteCount;

            CurrentUserCanComment =
                CommentPolicy == IdeaForumCommentPolicy.Open ||
                CommentPolicy == IdeaForumCommentPolicy.Moderated ||
                CommentPolicy == IdeaForumCommentPolicy.OpenToAuthenticatedUsers && _httpContext.Request.IsAuthenticated;
        }