public async Task <ActionResult <IngresoCompra> > Post(IngresoCompra ingresoCompra) { _context.IngresoCompra.Add(ingresoCompra); await _context.SaveChangesAsync(); return(CreatedAtAction("Get", new { id = ingresoCompra.IngresoCompraId }, ingresoCompra)); }
public async Task <IActionResult> Put(int id, IngresoCompra ingresoCompra) { if (id != ingresoCompra.IngresoCompraId) { return(BadRequest()); } _context.Entry(ingresoCompra).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IngresoCompraExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }