public static void AddItem(EVEItem item) { var result = (from t in _pricesContext.tblActiveItems where (t.itemID == item.TypeID) select t).ToList(); if (result.Count == 0) { tblActiveItem newItem = new tblActiveItem(); newItem.itemID = item.TypeID; newItem.isActive = true; newItem.lastUpdated = null; _pricesContext.tblActiveItems.InsertOnSubmit(newItem); _pricesContext.SubmitChanges(); } else { tblActiveItem foundItem = result.First(); if (foundItem.isActive == false) { foundItem.isActive = true; _pricesContext.SubmitChanges(); } } }
partial void DeletetblActiveItem(tblActiveItem instance);
partial void UpdatetblActiveItem(tblActiveItem instance);
partial void InserttblActiveItem(tblActiveItem instance);