public async Task <ActionResult <KeyIndicator> > PostKeyIndicator(KeyIndicator keyIndicator) { _context.KeyIndicators.Add(keyIndicator); await _context.SaveChangesAsync(); return(CreatedAtAction("GetKeyIndicator", new { id = keyIndicator.Id }, keyIndicator)); }
public async Task <IActionResult> PutKeyIndicator(Guid id, KeyIndicator keyIndicator) { if (id != keyIndicator.Id) { return(BadRequest()); } _context.Entry(keyIndicator).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KeyIndicatorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }