Entity Framework Update - The context is not currently tracking the entity
问题 I am trying to update an entity but I am getting the following error: The context is not currently tracking the entity. My DB table consists of the following fields: fixturedate, leagueID (FK), Team A (FK), Team B (FK). My code is as follows: public void UpdateFixture(Fixture validFixture) { Fixture fixture = new Fixture(); fixture = entities.Fixtures.Where(f => f.fixtureId == validFixture.fixtureId).FirstOrDefault(); League league = new League(); league.LeagueId = validFixture.leagueId;