//REMOVE VALUE public static void Remove(string key) { DBFrontEnd db = new DBFrontEnd(); Setting _v = db.Settings.SingleOrDefault(o => o.Key == key); if (_v != null) { db.Settings.Remove(_v); db.SaveChanges(); } }
//SET KEY = bla bla... public static void Set(string key, string value) { DBFrontEnd db = new DBFrontEnd(); Setting _v = db.Settings.SingleOrDefault(o => o.Key == key); if (_v != null) { //UPDATE VALUE _v.Value = value; } else { //CREAT VALUE Setting _n = new Setting(); _n.Key = key; _n.Value = value; db.Settings.Add(_n); } db.SaveChanges(); }