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 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));
        }
 public Post Post(ForumIdentityService forumIdentityService, Author author, string subject, string bodyText,
     PostId replyToPostId = null)
 {
     return new Post(this._tenantId, this._forumId, this._discussionId, forumIdentityService.GetNextPostId(),
         author, subject, bodyText, replyToPostId);
 }
 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;
 }