public static new string ToString() { StringBuilder res = new StringBuilder(); var data = list; if (PrintOnlyDistinctExceptions) { ExceptionComparer comparer = new ExceptionComparer(); data = data.Distinct(comparer).ToList(); } foreach (var item in data) { res.AppendFormat("{0}: {1}" + Environment.NewLine, item.Message, item.InnerException != null ? item.InnerException.Message : ""); res.AppendLine(); } return(res.ToString()); }
public override bool Equals(object obj) { var ObjToCompare = obj as LogModel; if (ObjToCompare == null) { return(false); } bool equality = ObjToCompare.UserID == UserID && ObjToCompare.UserLogin == UserLogin && ObjToCompare.LoggerName == LoggerName && ObjToCompare.CurrentApplication == CurrentApplication && ObjToCompare.LogMessage == LogMessage && ExceptionComparer.Compare(ObjToCompare.LogException, LogException) && (int)ObjToCompare.LogType == (int)LogType; return(equality && ObjToCompare is LogModel && ObjToCompare != null); }