Updating entity framework and replace thread with task