Esempio n. 1
0
        public async Task <IActionResult> PutSistemaDePago([FromRoute] int id, [FromBody] SistemaDePago sistemaDePago)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != sistemaDePago.Pago_ID)
            {
                return(BadRequest());
            }

            _context.Entry(sistemaDePago).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SistemaDePagoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> PostSistemaDePago([FromBody] SistemaDePago sistemaDePago)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.SistemaDePago.Add(sistemaDePago);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSistemaDePago", new { id = sistemaDePago.Pago_ID }, sistemaDePago));
        }