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))); }