public async Task <ActionResult <locataireDot> > PostlocataireDot(locataireDot locataireDot) { _context.locataireDot.Add(locataireDot); await _context.SaveChangesAsync(); return(CreatedAtAction("GetlocataireDot", new { id = locataireDot.Id }, locataireDot)); }
public async Task <IActionResult> PutlocataireDot(int id, locataireDot locataireDot) { if (id != locataireDot.Id) { return(BadRequest()); } _context.Entry(locataireDot).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!locataireDotExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }