コード例 #1
0
ファイル: PostEventSubscriber.cs プロジェクト: dev-4-dev/c-es
 private void Handle(PostCreated evnt)
 {
     using (var conn = _connectionFactory.OpenConnection())
     {
         conn.Insert(evnt, "EventSourcing_Sample_Post");
     }
 }
コード例 #2
0
ファイル: Forum.cs プロジェクト: dev-4-dev/c-es
        private void ChangeState(PostCreated postCreated)
        {
            var state = this.State.Clone(new
            {
                TotalPost          = this.State.TotalPost + 1,
                LatestPostAuthorId = postCreated.AuthorId
            });

            OnEventHappened(new ForumStateChanged(Id, state));
        }