public async Task <IActionResult> PutProjectKeyIndicator(Guid id, ProjectKeyIndicator projectKeyIndicator) { if (id != projectKeyIndicator.Id) { return(BadRequest()); } _context.Entry(projectKeyIndicator).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProjectKeyIndicatorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ProjectKeyIndicator> > PostProjectKeyIndicator(ProjectKeyIndicator projectKeyIndicator) { _context.ProjectKeyIndicators.Add(projectKeyIndicator); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProjectKeyIndicator", new { id = projectKeyIndicator.Id }, projectKeyIndicator)); }