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); }
public static void Default() { var db = new SingContext(); db.Database.EnsureCreated(); Verify(db, Version, Env.Version); Verify(db, Login, "nero"); Verify(db, IsBlockInternet, "true"); Verify(db, DNSExternalIP, "2.4.2.4"); Verify(db, DNSProxyIP, "1.1.1.1"); Verify(db, DNSProxyIP, "1.1.1.1"); }
public DNSService(SingContext context, IRequestResolver rev) { ctx = context; resolver = rev; }
public SignalRService(SingContext context, WorkerState state) { _state = state; ctx = context; }