Пример #1
0
 private void Handle(PostCreated evnt)
 {
     using (var conn = _connectionFactory.OpenConnection())
     {
         conn.Insert(evnt, "EventSourcing_Sample_Post");
     }
 }
Пример #2
0
        private void ChangeState(PostCreated postCreated)
        {
            var state = this.State.Clone(new
            {
                TotalPost          = this.State.TotalPost + 1,
                LatestPostAuthorId = postCreated.AuthorId
            });

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