Exemplo n.º 1
0
        public async Task <PaymentDTO> PatchAsync(PaymentUpdateDTO dto)
        {
            this.Logger.LogDebug($"{nameof(PaymentUpdateService)} called for {dto.PaymentId}");

            return(this.Mapper.Map <PaymentDTO>(
                       await this.PaymentUpdateService.UpdateAsync(Mapper.Map <PaymentUpdateModel>(dto))));
        }
Exemplo n.º 2
0
        public async Task Update(int id, PaymentUpdateDTO model)
        {
            var entry = _context.Payments.Single(x => x.PaymentId == id);

            entry.PaymentId     = model.PaymentId;
            entry.CreditCardId  = model.CreditCardId;
            entry.Description   = model.Description;
            entry.CvcCreditCard = model.CvcCreditCard;

            await _context.SaveChangesAsync();
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Update(int id, PaymentUpdateDTO model)
        {
            if (_PaymentService.Existencia(id) == true)
            {
                await _PaymentService.Update(id, model);

                return(NoContent());
            }
            else
            {
                return(NotFound());
            }
        }