public async Task <ActionResult <agenceImmob> > PostagenceImmob(agenceImmob agenceImmob) { _context.agenceImmobs.Add(agenceImmob); await _context.SaveChangesAsync(); return(CreatedAtAction("GetagenceImmob", new { id = agenceImmob.Id }, agenceImmob)); }
public async Task <IActionResult> PutagenceImmob(int id, agenceImmob agenceImmob) { if (id != agenceImmob.Id) { return(BadRequest()); } _context.Entry(agenceImmob).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!agenceImmobExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }