/// <summary> /// An override of the default ToString that will show all the information of the error Log record. /// </summary> /// <returns>string representing the ErrorLog record.</returns> public override string ToString() { StringBuilder sb = new StringBuilder(); try { sb.AppendLine(EnvironmentUserName); sb.AppendLine(ErrorType); sb.AppendLine(ErrorTime.ToString()); sb.AppendLine(ErrorText); } catch { sb.Append(base.ToString()); } return(sb.ToString()); }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + (ErrorLine == null ? 0 : ErrorLine.GetHashCode()); hash = hash * 23 + (ErrorMessage == null ? 0 : ErrorMessage.GetHashCode()); hash = hash * 23 + (ErrorNumber == default(int) ? 0 : ErrorNumber.GetHashCode()); hash = hash * 23 + (ErrorProcedure == null ? 0 : ErrorProcedure.GetHashCode()); hash = hash * 23 + (ErrorSeverity == null ? 0 : ErrorSeverity.GetHashCode()); hash = hash * 23 + (ErrorState == null ? 0 : ErrorState.GetHashCode()); hash = hash * 23 + (ErrorTime == default(DateTime) ? 0 : ErrorTime.GetHashCode()); hash = hash * 23 + (UserName == null ? 0 : UserName.GetHashCode()); return(hash); } }