public static bool UpdateUsuario(Usuario data) { using (InventioEntities context = new InventioEntities()) { //data.EntityKey = new EntityKey("InventioEntities.Usuario", "UserName", data.UserName); context.Attach(data); context.ObjectStateManager.GetObjectStateEntry(data).SetModified(); context.Refresh(RefreshMode.ClientWins, data); context.SaveChanges(); } return true; }
public static bool UpdateWidGet(WidGet data) { using (InventioEntities context = new InventioEntities()) { data.EntityKey = new EntityKey("InventioEntities.WidGet", "ID", data.ID); context.Attach(data); context.ObjectStateManager.GetObjectStateEntry(data).SetModified(); context.Refresh(RefreshMode.ClientWins, data); context.SaveChanges(); } return true; }