PPPDDDChap23.EventSourcing.Application.Infrastructure.PayAsYouGoAccountRepository.Save C# (CSharp) Method

Save() public method

public Save ( PayAsYouGoAccount payAsYouGoAccount ) : void
payAsYouGoAccount PPPDDDChap23.EventSourcing.Application.Model.PayAsYouGo.PayAsYouGoAccount
return void
        public void Save(PayAsYouGoAccount payAsYouGoAccount)
        {
            var streamName = string.Format("{0}-{1}", typeof(PayAsYouGoAccount).Name, payAsYouGoAccount.Id.ToString());

            _eventStore.AppendEventsToStream(streamName, payAsYouGoAccount.Changes);                      
        }

Usage Example

コード例 #1
0
ファイル: ImportTestData.cs プロジェクト: elbandit/PPPDDD
 private void PersistAllUncommittedEvents(PayAsYouGoAccountRepository repo)
 {
     repo.Save(account1);
     repo.Save(account2);
     repo.Save(account3);
     repo.Save(account4);
     repo.Save(account5);
 }