public async Task <ActionResult <RetornoLote> > PostRetornoLote(RetornoLote retornoLote) { _context.RetornosLote.Add(retornoLote); await _context.SaveChangesAsync(); return(CreatedAtAction("GetRetornoLote", new { id = retornoLote.ID }, retornoLote)); }
public async Task <IActionResult> PutRetornoLote(int id, RetornoLote retornoLote) { if (id != retornoLote.ID) { return(BadRequest()); } _context.Entry(retornoLote).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RetornoLoteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }