public override bool Equals(object obj) { StatementRecord other = obj as StatementRecord; if (other != null) { return((!string.IsNullOrEmpty(SourceFactId) && SourceFactId.Equals(other.SourceFactId)) || (Title.Equals(other.Title) && PeriodStart.Equals(other.PeriodStart) && PeriodEnd.Equals(other.PeriodEnd) && (FactId != null && FactId.Equals(other.FactId)))); } else { return(false); } }
public override int GetHashCode() { if (!string.IsNullOrEmpty(SourceFactId)) { return(SourceFactId.GetHashCode()); } else { unchecked // Overflow is fine, just wrap { int hash = 117; hash = hash * 123 + Title.GetHashCode(); hash = hash * 123 + PeriodStart.GetHashCode(); hash = hash * 123 + PeriodEnd.GetHashCode(); return(hash); } } }