public async Task <ActionResult <destinoCompra> > PostdestinoCompra(destinoCompra destinoCompra) { _context.destinoCompras.Add(destinoCompra); await _context.SaveChangesAsync(); return(CreatedAtAction("GetdestinoCompra", new { id = destinoCompra.DestinoCompraId }, destinoCompra)); }
public async Task <IActionResult> PutdestinoCompra(int id, destinoCompra destinoCompra) { if (id != destinoCompra.DestinoCompraId) { return(BadRequest()); } _context.Entry(destinoCompra).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!destinoCompraExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }