Exemplo n.º 1
0
 public static HotSpot GetHotSpot(String BssidToGet)
 {
     HotSpot obj = new HotSpot();
     using (var context = new HotSpotsDBEntities())
     {
         EntityKey key = new EntityKey("HotSpotsDBEntities.HotSpot", "bssid", BssidToGet);
         obj = (HotSpot)context.GetObjectByKey(key);
     }
     return obj;
 }
Exemplo n.º 2
0
 public static void DeleteHotSpot(String BssidToDelete)
 {
     HotSpot obj = new HotSpot();
     using (var context = new HotSpotsDBEntities())
     {
         EntityKey key = new EntityKey("HotSpotsDBEntities.HotSpot", "bssid", BssidToDelete);
         obj = (HotSpot)context.GetObjectByKey(key);
         if (obj != null)
         {
             context.DeleteObject(obj);
         }
         context.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public static bool AddHotSpot(HotSpot obj)
 {
     bool success = false;
     using (var context = new HotSpotsDBEntities())
     {
         EntityKey key = new EntityKey("HotSpotsDBEntities.HotSpot", "bssid", obj.bssid);
         if ((HotSpot)context.GetObjectByKey(key) == null)
         {
             context.AddToHotSpot(obj);
             context.SaveChanges();
             success = true;
         }
     }
     return success;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the HotSpot EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToHotSpot(HotSpot hotSpot)
 {
     base.AddObject("HotSpot", hotSpot);
 }
 /// <summary>
 /// Create a new HotSpot object.
 /// </summary>
 /// <param name="bssid">Initial value of the bssid property.</param>
 public static HotSpot CreateHotSpot(global::System.String bssid)
 {
     HotSpot hotSpot = new HotSpot();
     hotSpot.bssid = bssid;
     return hotSpot;
 }