Exemplo n.º 1
0
        public static BankAccount Rehydrate(OId <BankAccount, Guid> id, IEnumerable <BankAccountEvent> events)
        {
            var bankAccount = new BankAccount(id);

            bankAccount.Replay(events);
            return(bankAccount);
        }
Exemplo n.º 2
0
        public static BankAccount New(
            OId <BankAccount, Guid> id,
            OId <AccountHolder, Guid> accountHolderId,
            Iban iban,
            Currency accountCurrency,
            OId <Employee, Guid> employeeId,
            TimeStamp timeStamp)
        {
            var bankAccount = new BankAccount(id);

            bankAccount.Create(accountHolderId, iban, accountCurrency, employeeId, timeStamp);
            return(bankAccount);
        }
Exemplo n.º 3
0
 private void Create(
     OId <AccountHolder, Guid> accountHolderId,
     Iban accountIban,
     Currency accountCurrency,
     OId <Employee, Guid> employeeId,
     TimeStamp timeStamp)
 {
     RaiseEvent(new BankAccountCreated(AggregateId.Value,
                                       accountHolderId.Value,
                                       accountIban.Value,
                                       accountCurrency.Value,
                                       employeeId.Value,
                                       timeStamp.Value));
 }
Exemplo n.º 4
0
 private BankAccount(OId <BankAccount, Guid> id)
     : base(id)
 {
 }