public async Task <ActionResult <CreanceFinanciere> > PostCreanceFinanciere(CreanceFinanciere creanceFinanciere) { _context.creanceFinancieres.Add(creanceFinanciere); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCreanceFinanciere", new { id = creanceFinanciere.Id }, creanceFinanciere)); }
public async Task <IActionResult> PutCreanceFinanciere(int id, CreanceFinanciere creanceFinanciere) { if (id != creanceFinanciere.Id) { return(BadRequest()); } _context.Entry(creanceFinanciere).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CreanceFinanciereExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }