private PostComment projectComment(oxite_Comment comment, oxite_Blogs_PostCommentRelationship pcr, oxite_Blogs_Post p, oxite_Blogs_Blog b, oxite_User user) { PostCommentSmall parent = comment.ParentCommentID != comment.CommentID ? getParentComment(comment.ParentCommentID) : null; Language language = new Language(comment.oxite_Language.LanguageID) { DisplayName = comment.oxite_Language.LanguageDisplayName, Name = comment.oxite_Language.LanguageName }; if (user.Username != "Anonymous") { return(new PostComment(comment.Body, comment.CreatedDate, getUserAuthenticated(comment, user), comment.CreatorIP, comment.UserAgent, comment.CommentID, language, comment.ModifiedDate, parent, new PostSmall(p.PostID, b.BlogName, p.Slug, p.Title), pcr.Slug, (EntityState)comment.State)); } else { return(new PostComment(comment.Body, comment.CreatedDate, getUserAnonymous(comment, user), comment.CreatorIP, comment.UserAgent, comment.CommentID, language, comment.ModifiedDate, parent, new PostSmall(p.PostID, b.BlogName, p.Slug, p.Title), pcr.Slug, (EntityState)comment.State)); } }
private static PostCommentSmall projectPostCommentSmall(oxite_Comment comment, oxite_Blogs_PostCommentRelationship pcr, oxite_User user) { if (user.Username != "Anonymous") { return(new PostCommentSmall(new CommentSmall(comment.CommentID, comment.CreatedDate, getUserAuthenticated(comment, user)), pcr.Slug)); } else { return(new PostCommentSmall(new CommentSmall(comment.CommentID, comment.CreatedDate, getUserAnonymous(comment, user)), pcr.Slug)); } }