public async Task <ActionResult <OrdenesCredito> > PostOrdenesCredito(OrdenesCredito ordenesCredito) { _context.OrdenesCredito.Add(ordenesCredito); await _context.SaveChangesAsync(); return(CreatedAtAction("GetOrdenesCredito", new { id = ordenesCredito.Id }, ordenesCredito)); }
public async Task <IActionResult> PutOrdenesCredito(int id, OrdenesCredito ordenesCredito) { if (id != ordenesCredito.Id) { return(BadRequest()); } _context.Entry(ordenesCredito).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdenesCreditoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }