public Account CreateAccount(AccountType type, Customer customer) { IAccountFactory factory = new DefaultAccountFactory(); Account acc = factory.CreateAccount(type, customer); if (acc != null) { _accounts.Add(acc.AccountNumber, acc); acc.Customer = customer; customer.AddAccount(acc); } return(acc); }
public Account CreateAccount(AccountType type, Customer customer) { IAccountFactory factory = new DefaultAccountFactory(); Account acc = factory.CreateAccount(type, customer); if (acc != null) { _accounts.Add(acc.AccountNumber, acc); acc.Customer = customer; customer.AddAccount(acc); } return(EnableLogging ? new TracingAccount(acc) { Logger = Console.Out } : acc); }