Example #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 (Identification != null)
         {
             hashCode = hashCode * 59 + Identification.GetHashCode();
         }
         if (PersonalInfo != null)
         {
             hashCode = hashCode * 59 + PersonalInfo.GetHashCode();
         }
         if (EmploymentDetails != null)
         {
             hashCode = hashCode * 59 + EmploymentDetails.GetHashCode();
         }
         if (WorkLocations != null)
         {
             hashCode = hashCode * 59 + WorkLocations.GetHashCode();
         }
         if (Postings != null)
         {
             hashCode = hashCode * 59 + Postings.GetHashCode();
         }
         if (Contracts != null)
         {
             hashCode = hashCode * 59 + Contracts.GetHashCode();
         }
         if (Skills != null)
         {
             hashCode = hashCode * 59 + Skills.GetHashCode();
         }
         if (Specialties != null)
         {
             hashCode = hashCode * 59 + Specialties.GetHashCode();
         }
         if (Attributes != null)
         {
             hashCode = hashCode * 59 + Attributes.GetHashCode();
         }
         if (Visas != null)
         {
             hashCode = hashCode * 59 + Visas.GetHashCode();
         }
         if (WorkingRestrictions != null)
         {
             hashCode = hashCode * 59 + WorkingRestrictions.GetHashCode();
         }
         if (Availabilities != null)
         {
             hashCode = hashCode * 59 + Availabilities.GetHashCode();
         }
         if (PersonalPattern != null)
         {
             hashCode = hashCode * 59 + PersonalPattern.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #2
0
        /// <summary>
        /// Returns true if Person instances are equal
        /// </summary>
        /// <param name="other">Instance of Person to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Person other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Identification == other.Identification ||
                     Identification != null &&
                     Identification.Equals(other.Identification)
                     ) &&
                 (
                     PersonalInfo == other.PersonalInfo ||
                     PersonalInfo != null &&
                     PersonalInfo.Equals(other.PersonalInfo)
                 ) &&
                 (
                     EmploymentDetails == other.EmploymentDetails ||
                     EmploymentDetails != null &&
                     EmploymentDetails.Equals(other.EmploymentDetails)
                 ) &&
                 (
                     WorkLocations == other.WorkLocations ||
                     WorkLocations != null &&
                     WorkLocations.Equals(other.WorkLocations)
                 ) &&
                 (
                     Postings == other.Postings ||
                     Postings != null &&
                     other.Postings != null &&
                     Postings.SequenceEqual(other.Postings)
                 ) &&
                 (
                     Contracts == other.Contracts ||
                     Contracts != null &&
                     other.Contracts != null &&
                     Contracts.SequenceEqual(other.Contracts)
                 ) &&
                 (
                     Skills == other.Skills ||
                     Skills != null &&
                     other.Skills != null &&
                     Skills.SequenceEqual(other.Skills)
                 ) &&
                 (
                     Specialties == other.Specialties ||
                     Specialties != null &&
                     other.Specialties != null &&
                     Specialties.SequenceEqual(other.Specialties)
                 ) &&
                 (
                     Attributes == other.Attributes ||
                     Attributes != null &&
                     other.Attributes != null &&
                     Attributes.SequenceEqual(other.Attributes)
                 ) &&
                 (
                     Visas == other.Visas ||
                     Visas != null &&
                     other.Visas != null &&
                     Visas.SequenceEqual(other.Visas)
                 ) &&
                 (
                     WorkingRestrictions == other.WorkingRestrictions ||
                     WorkingRestrictions != null &&
                     other.WorkingRestrictions != null &&
                     WorkingRestrictions.SequenceEqual(other.WorkingRestrictions)
                 ) &&
                 (
                     Availabilities == other.Availabilities ||
                     Availabilities != null &&
                     Availabilities.Equals(other.Availabilities)
                 ) &&
                 (
                     PersonalPattern == other.PersonalPattern ||
                     PersonalPattern != null &&
                     PersonalPattern.Equals(other.PersonalPattern)
                 ));
        }