public string GetHeader() { StringBuilder result = new StringBuilder(); foreach (DataColumn c in EntityReader <LogEntry> .GetDataTable(false).Columns) { result.Append(string.Format("{0},", c.ColumnName)); } return(result.ToString().Remove(result.Length - 1)); }
public DataTable GetDataTable(string message, string exceptionName) { DataTable result = EntityReader <LogEntry> .GetDataTable(true); string messageLower = message.ToLower(); string exceptionNameLower = exceptionName.ToLower(); foreach (LogEntry le in _logEntries.Values) { if (le.Message.ToLower().Contains(messageLower) && le.ExceptionName.ToLower().Contains(exceptionNameLower)) { result.Rows.Add( le.Id, le.Type, le.CreationDate, le.Message, le.ExceptionName); } } return(result); }
public void ImportFromCsv(string filePath) { Clear(); _logEntries = null; _logEntries = DataTableToDictionary(CsvParser.ParseFromFile(filePath, true, EntityReader <LogEntry> .GetDataTable(true).Columns.Count)); }