public async Task <IActionResult> PutCarparkGraphData([FromRoute] string id, [FromBody] CarparkGraphData carparkGraphData) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != carparkGraphData.CarparkGraphDataID) { return(BadRequest()); } _context.Entry(carparkGraphData).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarparkGraphDataExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostCarparkGraphData([FromBody] CarparkGraphData carparkGraphData) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.CarparkGraphData.Add(carparkGraphData); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCarparkGraphData", new { id = carparkGraphData.CarparkGraphDataID }, carparkGraphData)); }