public static void Remove(Item item) { var db = new SoftwareStudioContext(); if (item != null) { db.Remove(item); db.SaveChanges(); } }
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(); } }