public async Task <IActionResult> PutTodoItem(long id, Employee employee) { if (id != employee.Id) { return(BadRequest()); } _context.Entry(employee).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TodoItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPlaylist(long id, Playlist playlist) { if (id != playlist.Id) { return(BadRequest()); } _context.Entry(playlist).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlaylistExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }