Skip to content

Instantly share code, notes, and snippets.

@tarikguney
Last active January 31, 2017 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarikguney/e72b125c02b77d7647de3b2fa4bccad7 to your computer and use it in GitHub Desktop.
Save tarikguney/e72b125c02b77d7647de3b2fa4bccad7 to your computer and use it in GitHub Desktop.
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