public DiscussionClosed(TenantId tenantId, ForumId forumId, DiscussionId discussionId, string exclusiveOwner)
        {
            this.TenantId = tenantId;
            this.ForumId = forumId;
            this.DiscussionId = discussionId;
            this.ExclusiveOwner = exclusiveOwner;

            this.EventVersion = 1;
            this.OccurredOn = DateTime.Now;
        }
        public Discussion(TenantId tenantId, ForumId forumId, DiscussionId discussionId, Author author, string subject, string exclusiveOwner = null)
        {
            AssertionConcern.NotNull(tenantId, "The tenant must be provided.");
            AssertionConcern.NotNull(forumId, "The forum id must be provided.");
            AssertionConcern.NotNull(discussionId, "The discussion id must be provided.");
            AssertionConcern.NotNull(author, "The author must be provided.");
            AssertionConcern.NotEmpty(subject, "The subject must be provided.");

            this.Apply(new DiscussionStarted(tenantId, forumId, discussionId, author, subject, exclusiveOwner));
        }
 public PostedToDiscussion(TenantId tenantIdId, ForumId forumId, DiscussionId discussionId, PostId postId,
     Author author, string subject, string bodyText, PostId replyToPostId)
 {
     this.TenantIdId = tenantIdId;
     this.ForumId = forumId;
     this.DiscussionId = discussionId;
     this.PostId = postId;
     this.Author = author;
     this.Subject = subject;
     this.BodyText = bodyText;
     this.ReplyToPostId = replyToPostId;
 }
        public DiscussionStarted(TenantId tenantId, ForumId forumId, DiscussionId discussionId, Author author,
            string subject, string exclusiveOwner)
        {
            this.TenantId = tenantId;
            this.ForumId = forumId;
            this.DiscussionId = discussionId;
            this.Author = author;
            this.Subject = subject;
            this.ExclusiveOwner = exclusiveOwner;

            this.EventVersion = 1;
            this.OccurredOn = DateTime.Now;
        }
        public PostedContentAltered(TenantId tenantId, ForumId forumId, DiscussionId discussionId, PostId postId,
            string subject, string bodyText)
        {
            this.TenantId = tenantId;
            this.ForumId = forumId;
            this.DiscussionId = discussionId;
            this.PostId = postId;
            this.Subject = subject;
            this.BodyText = bodyText;

            this.EventVersion = 1;
            this.OccurredOn = DateTime.Now;
        }
        public Post(TenantId tenantId, ForumId forumId, DiscussionId discussionId, PostId postId, Author author, 
            string subject, string bodyText, PostId replyToPostId=null)
        {
            AssertionConcern.NotNull(tenantId, "The tenant must be provided.");
            AssertionConcern.NotNull(forumId, "The forum id must be provided.");
            AssertionConcern.NotNull(discussionId, "The discussion id must be provided.");
            AssertionConcern.NotNull(postId, "The post id must be provided.");
            AssertionConcern.NotNull(author, "The author must be provided.");

            this.AssertPostContent(subject, bodyText);

            this.Apply(new PostedToDiscussion(tenantId, forumId, discussionId, postId, author, subject, bodyText, replyToPostId));
        }
 private void When(DiscussionStarted e)
 {
     this._tenantId = e.TenantId;
     this._forumId = e.ForumId;
     this._discussionId = e.DiscussionId;
     this._author = e.Author;
     this._subject = e.Subject;
     this._exclusiveOwner = e.ExclusiveOwner;
 }
 private void When(PostedToDiscussion e)
 {
     this._tenantId = e.TenantIdId;
     this._forumId = e.ForumId;
     this._discussionId = e.DiscussionId;
     this._postId = e.PostId;
     this._author = e.Author;
     this._subject = e.Subject;
     this._bodyText = e.BodyText;
     this._replyToPostId = e.ReplyToPostId;
 }