public static BankAccount Rehydrate(OId <BankAccount, Guid> id, IEnumerable <BankAccountEvent> events)
        {
            var bankAccount = new BankAccount(id);

            bankAccount.Replay(events);
            return(bankAccount);
        }
        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);
        }
 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));
 }
 private BankAccount(OId <BankAccount, Guid> id)
     : base(id)
 {
 }