public void Init() { using (var db = new LiteDatabase(ConnectionString)) { // StatusCount ClearStatusCount(); var col = db.GetCollection <StatusCount>("statusCount"); var statusCount = new StatusCount { PendingCount = 0, RunningCount = 0, DoneCount = 0, FailedCount = 0, WarningCount = 0, DisabledCount = 0, StoppedCount = 0 }; col.Insert(statusCount); // Entries ClearEntries(); } }
public void Init() { // StatusCount ClearStatusCount(); var statusCountCol = db.GetCollection <StatusCount>("statusCount"); var statusCount = new StatusCount { PendingCount = 0, RunningCount = 0, DoneCount = 0, FailedCount = 0, WarningCount = 0, DisabledCount = 0, StoppedCount = 0 }; statusCountCol.Insert(statusCount); // Entries ClearEntries(); // Insert default user if necessary var usersCol = db.GetCollection <User>("users"); if (usersCol.Count() == 0) { InsertDefaultUser(); } }