コード例 #1
0
 public ForumModeratorChanged(Tenant tenantId, ForumId forumId, Moderator moderator,string exclusiveOwner)
 {
     this.TenantId = tenantId;
     this.ForumId = forumId;
     this.Moderator = moderator;
     this.ExclusiveOwner = exclusiveOwner;
 }
コード例 #2
0
ファイル: Forum.cs プロジェクト: nutshellit/IDDD_Samples_NET
 public void ModeratePost(Post post, Moderator moderator, string subject, string bodyText)
 {
     AssertOpen();
     AssertionConcern.AssertArgumentNotNull(post, "Post may not be null.");
     AssertionConcern.AssertArgumentEquals(this.forumId, post.ForumId, "Not a post of this forum.");
     AssertionConcern.AssertArgumentTrue(IsModeratedBy(moderator), "Not the moderator of this forum.");
     post.AlterPostContent(subject, bodyText);
 }
コード例 #3
0
ファイル: ForumStarted.cs プロジェクト: asr0/IDDD_Samples_NET
 public ForumStarted(Tenant 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;
 }
コード例 #4
0
ファイル: Forum.cs プロジェクト: nutshellit/IDDD_Samples_NET
        public Forum(Tenant tenantId, ForumId forumId, Creator creator, Moderator moderator, string subject, string description, string exclusiveOwner)
        {
            AssertionConcern.AssertArgumentNotNull(tenantId, "The tenant must be provided.");
            AssertionConcern.AssertArgumentNotNull(forumId, "The forum id must be provided.");
            AssertionConcern.AssertArgumentNotNull(creator, "The creator must be provided.");
            AssertionConcern.AssertArgumentNotNull(moderator, "The moderator must be provided.");
            AssertionConcern.AssertArgumentNotEmpty(subject, "The subject must be provided.");
            AssertionConcern.AssertArgumentNotEmpty(description, "The description must be provided.");

            Apply(new ForumStarted(tenantId, forumId, creator, moderator, subject, description, exclusiveOwner));
        }
コード例 #5
0
ファイル: Forum.cs プロジェクト: nutshellit/IDDD_Samples_NET
 public bool IsModeratedBy(Moderator moderator)
 {
     return this.moderator.Equals(moderator);
 }
コード例 #6
0
ファイル: Forum.cs プロジェクト: nutshellit/IDDD_Samples_NET
 public void AssignModerator(Moderator moderator)
 {
     AssertOpen();
     AssertionConcern.AssertArgumentNotNull(moderator, "The moderator must be provided.");
     Apply(new ForumModeratorChanged(this.tenantId, this.forumId, moderator, this.exclusiveOwner));
 }
コード例 #7
0
ファイル: Forum.cs プロジェクト: nutshellit/IDDD_Samples_NET
 void When(ForumModeratorChanged e)
 {
     this.moderator = e.Moderator;
 }
コード例 #8
0
ファイル: Forum.cs プロジェクト: nutshellit/IDDD_Samples_NET
 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;
 }