public async Task <CuentaBancaria> CreateAccountAsync(CuentaBancaria cuentaBancaria) { EfModels.Models.CuentaBancaria ctn = _mapper.Map <EfModels.Models.CuentaBancaria>(cuentaBancaria); await _repository.CuentaBancarias.AddAsync(ctn); await _repository.SaveChangesAsync(); return(_mapper.Map <CuentaBancaria>(ctn)); }
public async Task <CuentaBancaria> FindBankAccountByNAccount(string NAccount, String Pin) { EfModels.Models.CuentaBancaria account = _repository.CuentaBancarias.FirstOrDefault(x => x.NCuenta == NAccount && x.Pin == Pin); if (account != null) { return(_mapper.Map <CuentaBancaria>(account)); } else { return(null); } }
public async Task <CuentaBancaria> FindBankAccount(int IdBankAccount) { EfModels.Models.CuentaBancaria cntBancaria = _repository.CuentaBancarias.FirstOrDefault(c => c.Id == IdBankAccount); return(_mapper.Map <CuentaBancaria>(cntBancaria)); }