/// <summary> /// Create a new instance of bankaccount /// </summary> /// <param name="customerId">The customer identifier</param> /// <param name="bankAccountNumber">The bank account number</param> /// <returns>A valid bank account</returns> public static BankAccount CreateBankAccount(Guid customerId, BankAccountNumber bankAccountNumber) { var bankAccount = new BankAccount(); //set the bank account number bankAccount.BankAccountNumber = bankAccountNumber; //set default bank account as unlocked bankAccount.UnLock(); //set the customer identifier bankAccount.CustomerId = customerId; return bankAccount; }
/// <summary> /// Create a new instance of bankaccount /// </summary> /// <param name="customer">The customer associated with this bank account</param> /// <param name="bankAccountNumber">The bank account number</param> /// <returns>A valid bank account</returns> public static BankAccount CreateBankAccount(Customer customer, BankAccountNumber bankAccountNumber) { var bankAccount = new BankAccount(); //set the bank account number bankAccount.BankAccountNumber = bankAccountNumber; //set default bank account as unlocked bankAccount.UnLock(); //set the customer for this bank account bankAccount.SetCustomer(customer); return bankAccount; }