public async Task <ActionResult <LocationIncrement> > PostLocationIncrement(LocationIncrement locationIncrement) { _context.LocationIncrements.Add(locationIncrement); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLocationIncrement", new { id = locationIncrement.Id }, locationIncrement)); }
public async Task <IActionResult> PutLocationIncrement(Guid id, LocationIncrement locationIncrement) { if (id != locationIncrement.Id) { return(BadRequest()); } _context.Entry(locationIncrement).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LocationIncrementExists(id)) { return(NotFound()); } else { return(StatusCode(StatusCodes.Status500InternalServerError)); } } return(NoContent()); }