Пример #1
0
 internal static void CleanLoggingDB(string databaseConnectionString)
 {
     using (var db = new LoggingDataContext(databaseConnectionString))
     {
         db.CategoryLogs.DeleteAllOnSubmit(db.CategoryLogs);
         db.Logs.DeleteAllOnSubmit(db.Logs);
         db.SubmitChanges();
     }
 }
Пример #2
0
        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;
            }
        }
Пример #3
0
 internal static List<Log> GetExceptionsFromDB(string databaseConnectionString)
 {
     using (var db = new LoggingDataContext(databaseConnectionString))
     {
         return db.Logs.Where(e => e.Severity == "Error").ToList();
     }
 }
Пример #4
0
 internal static Log GetFirstLog(string databaseConnectionString)
 {
     using (var db = new LoggingDataContext(databaseConnectionString))
     {
         return db.Logs.FirstOrDefault();
     }
 }