Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.