Exemplo n.º 1
0
        public async Task <Payment_Model> GetPayment(long id)
        {
            Payment_EfModel paymentDb = await _context.Payment.Where(p => p.Id == id).SingleOrDefaultAsync();

            Payment_Model payment = _iMapper.Map <Payment_Model>(paymentDb);

            return(payment);
        }
Exemplo n.º 2
0
        public async Task <bool> AddPayment(Payment_Model entity)
        {
            Payment_EfModel paymentDb = _iMapper.Map <Payment_EfModel>(entity);
            await _context.Payment.AddAsync(paymentDb);

            await _context.SaveChangesAsync();

            Payment_EfModel checkDb = await _context.Payment.Where(p => p.Id == paymentDb.Id).SingleOrDefaultAsync();

            if (checkDb == null)
            {
                return(false);
            }

            return(true);
        }