Account Creator Class for Medium
public class AccountCreator { | |
private IAccountChecker _accountChecker; | |
private AccountRepository _accountRepository; | |
public AccountCreator(IAccountChecker accountChecker){ | |
_accountChecker = accountChecker; | |
_accountRepository = new AccountRepository(); | |
} | |
public bool TryCreateAccount(AccountInfo accountInfo){ | |
if(!_accountChecker.Exists(accountInfo.AccountNumber){ | |
_accountCreator.Create(accountInfo); | |
return true; | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment