Question : .net SaveChanges vs update difference
Answered by : doubtful-dugong-d9acmxueqcbu
using (var context = new UserContext())
{ // Query for the entity. var user = context.Users.Single(e => e.Name == "Arthur"); // Entity is now tracked. Make a change to it. user.Email = "[email protected]"; // EF will detect the change and update only the column that has changed. context.SaveChanges();
}
Source : https://blog.oneunicorn.com/2020/01/17/dontcallupdate/ | Last Update : Mon, 23 May 22