public BankAccountModel createAccount(string CustomerName, string CustomerID, string AccountNumber, float InitialBalance) { BankAccountRepository repository = new BankAccountRepository(this._context); var account = repository.getByAccountNumber(AccountNumber); if (account != null) { throw new Exception("there's another bank account with this Bank Number."); } account = repository.createAccount(CustomerName, CustomerID, AccountNumber, InitialBalance); return(BanckAccountMapper.toModel(account)); }
public List <BankAccountModel> getByCustomerID(string OwnerCustomerID) { BankAccountRepository repository = new BankAccountRepository(this._context); return(repository.getByCustomerID(OwnerCustomerID).Select(a => BanckAccountMapper.toModel(a)).ToList()); }
public BankAccountModel getByAccountToken(Guid token) { BankAccountRepository repository = new BankAccountRepository(this._context); return(BanckAccountMapper.toModel(repository.getByAccountToken(token))); }
public BankAccountModel getByAccountNumber(string AccountNumber) { BankAccountRepository repository = new BankAccountRepository(this._context); return(BanckAccountMapper.toModel(repository.getByAccountNumber(AccountNumber))); }