public async Task <IActionResult> PutBlueEvent([FromRoute] int id, [FromBody] BlueEvent blueEvent) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != blueEvent.Eventid) { return(BadRequest()); } _context.Entry(blueEvent).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BlueEventExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBlueEvent([FromBody] BlueEvent blueEvent) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BlueEvent.Add(blueEvent); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBlueEvent", new { id = blueEvent.Eventid }, blueEvent)); }