コード例 #1
0
 public void Handle(AccountAddedEvent e)
 {
     this.Id                 = e.AggregateId;
     this.Version            = e.Version;
     this.CustomerId         = e.CustomerId;
     this.Currency           = e.Currency;
     this.Balance            = 0;
     this.State              = e.AccountState;
 }
コード例 #2
0
 public static AccountDomainModel CreateNewInstance(
     Guid id,
     Guid customerId,
     int version,
     string currency,
     State accountState)
 {
     var @event = new AccountAddedEvent
     {
         AggregateId         = id,
         CustomerId          = customerId,
         Version             = version,
         Currency            = currency,
         AccountState        = accountState
     };
     var account = new AccountDomainModel();
     account.ApplyChange(@event);
     return account;
 }