Пример #1
0
 public void Handle(DiscussionStarted @event)
 {
     _userId       = @event.UserId;
     _forumId      = @event.ForumId;
     _discussionId = @event.DiscussionId;
     _author       = @event.Author;
     _subject      = @event.Subject;
     _closed       = false;
 }
Пример #2
0
        public Discussion(
            string userId,
            ForumId forumId,
            DiscussionId discussionId,
            Author author,
            string subject)
        {
            Assert.NotNullOrEmpty(userId, nameof(userId));
            Assert.NotNull(forumId, nameof(forumId));
            Assert.NotNull(discussionId, nameof(discussionId));
            Assert.NotNull(author, nameof(author));
            Assert.NotNullOrEmpty(subject, nameof(subject));

            Apply(new DiscussionStarted(userId, forumId, discussionId, author, subject));
        }