Example #1
0
        public Guid InsertNewAccount(Guid CustomerID, decimal Balance)
        {
            var newAccount = _dataFactory.CreateAccount();

            newAccount.AccountID     = Guid.NewGuid();
            newAccount.CustomerID    = CustomerID;
            newAccount.AccountNumber = GenerateAccountNumber();
            newAccount.Balance       = Balance;

            _database.Accounts.Add(newAccount);

            return(newAccount.AccountID);
        }