public async Task <ActionResult <CommandeM> > PostCommandeM(CommandeM commandeM) { _context.CommandeMains.Add(commandeM); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCommandeM", new { id = commandeM.CommandeMId }, commandeM)); }
public async Task <IActionResult> PutCommandeM(long id, CommandeM commandeM) { if (id != commandeM.CommandeMId) { return(BadRequest()); } _context.Entry(commandeM).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CommandeMExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }