public async Task <ActionResult <contratLocation> > PostcontratLocation(contratLocation contratLocation) { _context.contratLocations.Add(contratLocation); await _context.SaveChangesAsync(); return(CreatedAtAction("GetcontratLocation", new { id = contratLocation.Id }, contratLocation)); }
public async Task <IActionResult> PutcontratLocation(int id, contratLocation contratLocation) { if (id != contratLocation.Id) { return(BadRequest()); } _context.Entry(contratLocation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!contratLocationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }