public async Task <IActionResult> PutProjectKeyIndicatorYear(Guid id, ProjectKeyIndicatorYear projectKeyIndicatorYear) { if (id != projectKeyIndicatorYear.Id) { return(BadRequest()); } _context.Entry(projectKeyIndicatorYear).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProjectKeyIndicatorYearExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ProjectKeyIndicatorYear> > PostProjectKeyIndicatorYear(ProjectKeyIndicatorYear projectKeyIndicatorYear) { _context.ProjectKeyIndicatorYears.Add(projectKeyIndicatorYear); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProjectKeyIndicatorYear", new { id = projectKeyIndicatorYear.Id }, projectKeyIndicatorYear)); }