public BusinessLoggingController(LiteDB.LiteDatabase db, ILogger <BusinessLoggingController> logger) { m_db = db; m_col = m_db.GetCollection <LogEntry>("LogEntries"); _logger = logger; if (m_col.Count() == 0) { m_col.Insert(new LogEntry() { Level = 1, Project = 1, Topic = "Test", Message = "Test message" }); logger.LogInformation("Added default entry"); } }
public static void Load() { var flowsDb = new LiteDB.LiteDatabase(System.Environment.CurrentDirectory + "\\Flows.db"); FlowsData.FlowTable = flowsDb.GetCollection <AppFlowEvent>("Flows"); }