コード例 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (QuestionAndAnswer != null)
         {
             hashCode = hashCode * 59 + QuestionAndAnswer.GetHashCode();
         }
         if (Applicant != null)
         {
             hashCode = hashCode * 59 + Applicant.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if RequestIntakeApplication instances are equal
        /// </summary>
        /// <param name="other">Instance of RequestIntakeApplication to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RequestIntakeApplication other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     QuestionAndAnswer == other.QuestionAndAnswer ||
                     QuestionAndAnswer != null &&
                     QuestionAndAnswer.SequenceEqual(other.QuestionAndAnswer)
                     ) &&
                 (
                     Applicant == other.Applicant ||
                     Applicant != null &&
                     Applicant.Equals(other.Applicant)
                 ));
        }