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));
        }
        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;
 }