예제 #1
0
        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));
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
 public async Task <CuentaBancaria> FindBankAccount(int IdBankAccount)
 {
     EfModels.Models.CuentaBancaria cntBancaria =
         _repository.CuentaBancarias.FirstOrDefault(c => c.Id == IdBankAccount);
     return(_mapper.Map <CuentaBancaria>(cntBancaria));
 }