public async Task <IActionResult> PutEvents(int id, Events events) { if (id != events.Id) { return(BadRequest()); } _context.Entry(events).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }