コード例 #1
0
        public ForumModeratorChanged(TenantId tenantId, ForumId forumId, Moderator moderator, string exclusiveOwner)
        {
            this.TenantId = tenantId;
            this.ForumId = forumId;
            this.Moderator = moderator;
            this.ExclusiveOwner = exclusiveOwner;

            this.EventVersion = 1;
            this.OccurredOn = DateTime.Now;
        }
コード例 #2
0
        public Forum(TenantId tenantId, ForumId forumId, Creator creator, Moderator moderator, string subject,
            string description, string exclusiveOwner)
        {
            AssertionConcern.NotNull(tenantId, "The tenant must be provided.");
            AssertionConcern.NotNull(forumId, "The forum id must be provided.");
            AssertionConcern.NotNull(creator, "The creator must be provided.");
            AssertionConcern.NotNull(moderator, "The moderator must be provided.");
            AssertionConcern.NotEmpty(subject, "The subject must be provided.");
            AssertionConcern.NotEmpty(description, "The description must be provided.");

            this.Apply(new ForumStarted(tenantId, forumId, creator, moderator, subject, description, exclusiveOwner));
        }
コード例 #3
0
        public ForumStarted(TenantId tenantId, ForumId forumId, Creator creator, Moderator moderator, string subject,
            string description, string exclusiveOwner)
        {
            this.TenantId = tenantId;
            this.ForumId = forumId;
            this.Creator = creator;
            this.Moderator = moderator;
            this.Subject = subject;
            this.Description = description;
            this.ExclusiveOwner = exclusiveOwner;

            this.EventVersion = 1;
            this.OccurredOn = DateTime.Now;
        }
コード例 #4
0
 public void ModeratePost(Post post, Moderator moderator, string subject, string bodyText)
 {
     this.AssertOpen();
     AssertionConcern.NotNull(post, "Post may not be null.");
     AssertionConcern.Equals(this._forumId, post.ForumId, "Not a post of this forum.");
     AssertionConcern.True(this.IsModerateBy(moderator), "Not the moderator of this forum.");
     post.AlterPostContent(subject, bodyText);
 }
コード例 #5
0
 public bool IsModerateBy(Moderator moderator)
 {
     return this._moderator.Equals(moderator);
 }
コード例 #6
0
 public void AssignModerator(Moderator moderator)
 {
     this.AssertOpen();
     AssertionConcern.NotNull(moderator, "The moderator must be provided.");
     this.Apply(new ForumModeratorChanged(this._tenantId, this._forumId, moderator, this._exclusiveOwner));
 }
コード例 #7
0
 private void When(ForumModeratorChanged e)
 {
     this._moderator = e.Moderator;
 }
コード例 #8
0
 private void When(ForumStarted e)
 {
     this._tenantId = e.TenantId;
     this._forumId = e.ForumId;
     this._creator = e.Creator;
     this._moderator = e.Moderator;
     this._subject = e.Subject;
     this._description = e.Description;
     this._exclusiveOwner = e.ExclusiveOwner;
 }