public void Update1IsOK() { var context = new CarContext(); var testContext = new EFRepository<Car,int>(context); var all = context.Car.ToList(); all.ForEach(r => testContext.Delete(r)); testContext.Save(); var car = new Car() { CarName = "Ford", CarPrice = 100000 }; testContext.Insert(car); testContext.Save(); car.CarPrice = 99999; car.CarName = "Ford1"; testContext.Update(car, x => new { x.CarPrice }); testContext.Save(); var cars = testContext.GetDbSet().AsNoTracking().ToList();//OK var cars1 = testContext.GetDbSet().ToList();//error Assert.AreEqual(cars.Count, 1); Assert.AreEqual(cars.FirstOrDefault().CarName, "Ford"); Assert.AreEqual(cars.FirstOrDefault().CarPrice, 100000 - 1); }