示例#1
0
        /// <summary>
        /// Returns true if Skill instances are equal
        /// </summary>
        /// <param name="other">Instance of Skill to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Skill other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     SkillGroup == other.SkillGroup ||
                     SkillGroup != null &&
                     SkillGroup.Equals(other.SkillGroup)
                     ) &&
                 (
                     Cluster == other.Cluster ||
                     Cluster != null &&
                     Cluster.Equals(other.Cluster)
                 ) &&
                 (
                     _Skill == other._Skill ||
                     _Skill != null &&
                     _Skill.Equals(other._Skill)
                 ) &&
                 (
                     Validity == other.Validity ||
                     Validity != null &&
                     Validity.Equals(other.Validity)
                 ) &&
                 (
                     DateGained == other.DateGained ||
                     DateGained != null &&
                     DateGained.Equals(other.DateGained)
                 ) &&
                 (
                     ObtainedFromReason == other.ObtainedFromReason ||
                     ObtainedFromReason != null &&
                     ObtainedFromReason.Equals(other.ObtainedFromReason)
                 ) &&
                 (
                     CertificateNumber == other.CertificateNumber ||
                     CertificateNumber != null &&
                     CertificateNumber.Equals(other.CertificateNumber)
                 ) &&
                 (
                     Notes == other.Notes ||
                     Notes != null &&
                     Notes.Equals(other.Notes)
                 ));
        }
示例#2
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 (SkillGroup != null)
         {
             hashCode = hashCode * 59 + SkillGroup.GetHashCode();
         }
         if (Cluster != null)
         {
             hashCode = hashCode * 59 + Cluster.GetHashCode();
         }
         if (_Skill != null)
         {
             hashCode = hashCode * 59 + _Skill.GetHashCode();
         }
         if (Validity != null)
         {
             hashCode = hashCode * 59 + Validity.GetHashCode();
         }
         if (DateGained != null)
         {
             hashCode = hashCode * 59 + DateGained.GetHashCode();
         }
         if (ObtainedFromReason != null)
         {
             hashCode = hashCode * 59 + ObtainedFromReason.GetHashCode();
         }
         if (CertificateNumber != null)
         {
             hashCode = hashCode * 59 + CertificateNumber.GetHashCode();
         }
         if (Notes != null)
         {
             hashCode = hashCode * 59 + Notes.GetHashCode();
         }
         return(hashCode);
     }
 }