internal static void CleanLoggingDB(string databaseConnectionString) { using (var db = new LoggingDataContext(databaseConnectionString)) { db.CategoryLogs.DeleteAllOnSubmit(db.CategoryLogs); db.Logs.DeleteAllOnSubmit(db.Logs); db.SubmitChanges(); } }
internal static string GetFirstLogFormattedMessage(string databaseConnectionString) { using (var db = new LoggingDataContext(databaseConnectionString)) { var log = db.Logs.Where(e => e.FormattedMessage.Contains("Extended Properties: value - testing title")).SingleOrDefault(); if (log == null) return null; return log.FormattedMessage; } }
internal static List<Log> GetExceptionsFromDB(string databaseConnectionString) { using (var db = new LoggingDataContext(databaseConnectionString)) { return db.Logs.Where(e => e.Severity == "Error").ToList(); } }
internal static Log GetFirstLog(string databaseConnectionString) { using (var db = new LoggingDataContext(databaseConnectionString)) { return db.Logs.FirstOrDefault(); } }