public async Task <ActionResult <StockInterne> > PostStockInterne(StockInterne stockInterne) { _context.StockInterne.Add(stockInterne); await _context.SaveChangesAsync(); return(CreatedAtAction("GetStockInterne", new { id = stockInterne.StockId }, stockInterne)); }
public async Task <IActionResult> PutStockInterne(int id, StockInterne stockInterne) { if (id != stockInterne.StockId) { return(BadRequest()); } _context.Entry(stockInterne).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StockInterneExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }