public async Task <IActionResult> PutCumulativePoints(string id, CumulativePoints cumulativePoints) { if (id != cumulativePoints.Id) { return(BadRequest()); } _context.Entry(cumulativePoints).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CumulativePointsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <CumulativePoints> > PostCumulativePoints(CumulativePoints cumulativePoints) { _context.CumulativePoints.Add(cumulativePoints); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (CumulativePointsExists(cumulativePoints.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetCumulativePoints", new { id = cumulativePoints.Id }, cumulativePoints)); }