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; }
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(); } }
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<T> 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; }