public UsersController(ICreateAccount createAccount)
 {
     _createAccount = createAccount;
 }
 public CreateAccountService(ICreateAccount createAccount, IPasswordService passwordSvc)
 {
     this.createAccount = createAccount;
     this.passwordSvc   = passwordSvc;
 }
Ejemplo n.º 3
0
        public Account CreateAccount(string firstName, string secondName, string email, decimal balance, IAccountNumberGenerator generator, ICreateAccount creator)
        {
            //здесь подумать как передать какой именно аккаунт
            if (firstName == null)
            {
                throw new ArgumentNullException(nameof(firstName));
            }

            if (secondName == null)
            {
                throw new ArgumentNullException(nameof(secondName));
            }

            if (email == null)
            {
                throw new ArgumentNullException(nameof(email));
            }

            string  id  = generator.GenerateAccountNumber();
            Account acc = creator.Create(id, firstName, secondName, email, balance);

            repos.Save(acc);
            return(acc);
        }