I got this code that I use for User Create.
public static void CreateUser(User user)
{
Save<User>(u => u.AddObject(user));
}
Save<T>(Action<ObjectSet<T>> func)
where T : class
{
...
func(entitySet);
entitiesContext.SaveChanges();
}
Now I am trying to write an update method, but it doesn’t compile on u = user
public static void UpdateUser(User user)
{
Save<User>(u => u = user);
}
How do I update an object?
If the entity is detached from context you can update it as follows.