예제 #1
0
 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;
 }
예제 #2
0
 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;
 }