private static CommentSmall projectCommentSmall(oxite_Comment comment, oxite_User user) { if (user.Username != "Anonymous") { return(new CommentSmall(comment.CommentID, comment.CreatedDate, getUserAuthenticated(comment, user))); } else { return(new CommentSmall(comment.CommentID, comment.CreatedDate, getUserAnonymous(comment, user))); } }
public void ChangeState(Guid commentID, EntityState state) { oxite_Comment comment = context.oxite_Comments.FirstOrDefault(c => c.CommentID == commentID); if (comment != null) { comment.State = (byte)state; } context.SubmitChanges(); }
private Comment getComment(oxite_Comment comment, oxite_User user) { CommentSmall 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 Comment(comment.Body, comment.CreatedDate, getUserAuthenticated(comment, user), comment.CreatorIP, comment.UserAgent, comment.CommentID, language, comment.ModifiedDate, parent, (EntityState)comment.State)); } else { return(new Comment(comment.Body, comment.CreatedDate, getUserAnonymous(comment, user), comment.CreatorIP, comment.UserAgent, comment.CommentID, language, comment.ModifiedDate, parent, (EntityState)comment.State)); } }
private static UserAnonymous getUserAnonymous(oxite_Comment comment, oxite_User user) { return(new UserAnonymous(comment.CreatorName, comment.CreatorEmail, comment.CreatorHashedEmail, comment.CreatorUrl)); }
private static User getUserAuthenticated(oxite_Comment comment, oxite_User user) { return(new User(user.UserID, user.Username, user.DisplayName, user.Email, user.HashedEmail, (EntityState)user.Status)); }
private void detach_oxite_Comments(oxite_Comment entity) { this.SendPropertyChanging(); entity.oxite_Language = null; }
partial void Deleteoxite_Comment(oxite_Comment instance);
private void attach_oxite_Comments(oxite_Comment entity) { this.SendPropertyChanging(); entity.oxite_User = this; }
partial void Updateoxite_Comment(oxite_Comment instance);
partial void Insertoxite_Comment(oxite_Comment instance);