public int CompareTo(TransactionAdapter other) { if (0 != Amount.CompareTo(other.Amount)) { return(Amount.CompareTo(other.Amount)); } if (0 != Originator.CompareTo(other.Originator)) { return(Originator.CompareTo(other.Originator)); } if (0 != BeneficiaryName.CompareTo(other.BeneficiaryName)) { return(BeneficiaryName.CompareTo(other.BeneficiaryName)); } if (0 != BeneficiaryAccount.CompareTo(other.BeneficiaryAccount)) { return(BeneficiaryAccount.CompareTo(other.BeneficiaryAccount)); } if (0 != Currency.CompareTo(other.Currency)) { return(Currency.CompareTo(other.Currency)); } if (0 != ExecutionDate.CompareTo(other.ExecutionDate)) { return(ExecutionDate.CompareTo(other.ExecutionDate)); } if (0 != RemittanceInfo.CompareTo(other.RemittanceInfo)) { return(RemittanceInfo.CompareTo(other.RemittanceInfo)); } return(Transaction.CompareTo(other.Transaction)); }
public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ (TestId.HasValue ? TestId.Value : 0); hashCode = (hashCode * 397) ^ ExecutionDate.GetHashCode(); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ State.GetHashCode(); hashCode = (hashCode * 397) ^ (ExQuestions != null ? ExQuestions.GetHashCode() : 0); return(hashCode); } }
public bool Equals(ExTest other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } var returned = Id == other.Id && TestId == other.TestId && ExecutionDate.Equals(other.ExecutionDate) && Name == other.Name && State == other.State; return(ExQuestions.Aggregate(returned, (current, question) => current && other.ExQuestions.Contains(question))); }