예제 #1
0
        public override int GetHashCode()
        {
            var hash = Name == null ? 0 : Name.GetHashCode();

            hash += Acquired.GetHashCode();
            hash += Category.GetHashCode();
            hash += SubCategory == null ? 0 : SubCategory.GetHashCode();
            hash += InUse.GetHashCode();
            hash += Owner == null ? 0 : Owner.GetHashCode();
            hash += PartOf == null ? 0 : PartOf.GetHashCode();
            return(hash);
        }
예제 #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 (Tag != null)
         {
             hashCode = hashCode * 59 + Tag.GetHashCode();
         }
         if (InUse != null)
         {
             hashCode = hashCode * 59 + InUse.GetHashCode();
         }
         if (IsValid != null)
         {
             hashCode = hashCode * 59 + IsValid.GetHashCode();
         }
         return(hashCode);
     }
 }