public async Task <ActionResult <locationUnite> > PostlocationUnite(locationUnite locationUnite) { _context.locationUnites.Add(locationUnite); await _context.SaveChangesAsync(); return(CreatedAtAction("GetlocationUnite", new { id = locationUnite.Id }, locationUnite)); }
public async Task <IActionResult> PutlocationUnite(int id, locationUnite locationUnite) { if (id != locationUnite.Id) { return(BadRequest()); } _context.Entry(locationUnite).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!locationUniteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }