예제 #1
0
        private void Handle(BookLent evnt)
        {
            var key   = new { LibraryId = evnt.LibraryId, BookId = evnt.BookId };
            var count = _connection.GetValue <int>(key, "EventSourcing_Sample_BookStoreItem", "Count", _transaction);

            _connection.Update(
                new { Count = count - evnt.Count },
                key,
                "EventSourcing_Sample_BookStoreItem", _transaction);
        }
예제 #2
0
파일: Library.cs 프로젝트: dev-4-dev/c-es
        private void Handle(BookLent evnt)
        {
            var bookStoreItem = _bookStoreItems.Single(x => x.BookId == evnt.BookId);

            bookStoreItem.SetCount(bookStoreItem.Count - evnt.Count);
        }