Exemplo n.º 1
0
        public async Task Update(int id, TarjetaUpdateDto model)
        {
            var entry = await _context.Tarjetas.SingleAsync(x => x.TarjetaId == id);

            entry.Fecha_expiracion = model.Fecha_expiracion;
            entry.Nombre_poseedor  = model.Nombre_poseedor;
            entry.Numero_tarjeta   = model.Numero_tarjeta;
            await _context.SaveChangesAsync();
        }
        public async Task <ActionResult> Update(int id, TarjetaUpdateDto model)
        {
            if (_TarjetaService.Existencia(id) == true)
            {
                await _TarjetaService.Update(id, model);

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