public async Task <IActionResult> PutEvent(int id, Event events) { if (id != events.Id) { return(BadRequest()); } _context.Entry(events).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFriendsList(int id, FriendsList friendsList) { if (id != friendsList.FriendsId) { return(BadRequest()); } _context.Entry(friendsList).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FriendsListExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }