public async Task <ActionResult <TypeStockage> > PostTypeStockage(TypeStockage typeStockage) { _context.TypeStockages.Add(typeStockage); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTypeStockage", new { id = typeStockage.Id }, typeStockage)); }
public async Task <IActionResult> PutTypeStockage(int id, TypeStockage typeStockage) { if (id != typeStockage.Id) { return(BadRequest()); } _context.Entry(typeStockage).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeStockageExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }