internal static List <Trace> GetExceptionsFromDB(string databaseConnectionString) { using (var db = new TracingDataContext(databaseConnectionString)) { return(db.Traces.Where(e => e.Level == 2).ToList()); } }
internal static Trace GetFirstLog(string databaseConnectionString) { using (var db = new TracingDataContext(databaseConnectionString)) { return(db.Traces.FirstOrDefault()); } }
internal static List <Trace> GetAllLogEntries(string databaseConnectionString) { using (var db = new TracingDataContext(databaseConnectionString)) { return(db.Traces.ToList()); } }
internal static void CleanLoggingDB(string databaseConnectionString) { using (var db = new TracingDataContext(databaseConnectionString)) { db.Traces.DeleteAllOnSubmit(db.Traces); db.SubmitChanges(); } }
internal static string GetFirstLogFormattedMessage(string databaseConnectionString) { using (var db = new TracingDataContext(databaseConnectionString)) { var log = db.Traces.Where(e => e.FormattedMessage.Contains("Extended Properties: value - testing title")).SingleOrDefault(); if (log == null) { return(null); } return(log.FormattedMessage); } }