public async Task <ActionResult <SoldeConge> > PostSoldeConge(SoldeConge soldeConge) { _context.soldeConges.Add(soldeConge); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSoldeConge", new { id = soldeConge.Id }, soldeConge)); }
public async Task <IActionResult> PutSoldeConge(int id, SoldeConge soldeConge) { if (id != soldeConge.Id) { return(BadRequest()); } _context.Entry(soldeConge).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SoldeCongeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }