예제 #1
0
 public static void Borrar(int id)
 {
     using (var context = new WakeOnLanContext())
     {
         if (id != 0)
         {
             Dispositivos Obj = GetByID(id);
             context.Dispositivos.Remove(Obj);
             context.SaveChanges();
         }
     }
 }
예제 #2
0
 public static int Guardar(Dispositivos Obj)
 {
     using (var context = new WakeOnLanContext())
     {
         if (Obj.Id == 0)
         {
             context.Dispositivos.Add(Obj);
         }
         else
         {
             context.Dispositivos.Update(Obj);
         }
         context.SaveChanges();
     }
     return(Obj.Id);
 }