public static async void RemoveItem(int itemID) { var db = new SoftwareStudioContext(); Laboratory_item labItem = await db.laboratory_items.FirstOrDefaultAsync(labItem => labItem.item_id == itemID); if (labItem != null) { db.Remove(labItem); db.SaveChanges(); } }
public static void AddItem(int labID, int itemID) { var db = new SoftwareStudioContext(); Laboratory_item labItem = new Laboratory_item(labID, itemID); if (labItem != null) { db.laboratory_items.Add(labItem); db.SaveChanges(); } }