private static void Verify(SingContext db, string key, string value) { if (!db.Settings.Any(x => x.Key == key)) { return; } db.Add(new Setting(key, value)); db.SaveChanges(); }
public static void Set(string key, string value) { var ctx = new SingContext(); if (If(key)) { ctx.Settings.First(x => x.Key == key).Value = value; ctx.SaveChanges(); return; } Verify(ctx, key, value); }