示例#1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Age;
         hashCode = (hashCode * 397) ^ (Father != null ? Father.GetHashCode() : 0);
         return(hashCode);
     }
 }
示例#2
0
 /// <summary>
 ///    Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 ///    A hash code for the current <see cref="T:System.Object" />.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (FirstName != null ? FirstName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MiddleInitial != null ? MiddleInitial.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ BirthDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (Father != null ? Father.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Mother != null ? Mother.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Children != null ? Children.GetHashCode() : 0);
         return(hashCode);
     }
 }
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + Name.GetHashCode();
            hash = hash * 23 + Culture.GetHashCode();
            hash = hash * 23 + Titles.GetHashCode();
            hash = hash * 23 + OtherTitles.GetHashCode();
            hash = hash * 23 + Aliases.GetHashCode();
            hash = hash * 23 + Born.GetHashCode();
            hash = hash * 23 + Died.GetHashCode();
            hash = hash * 23 + Father.GetHashCode();
            hash = hash * 23 + Mother.GetHashCode();
            hash = hash * 23 + Spouse.GetHashCode();
            hash = hash * 23 + Children.GetHashCode();
            hash = hash * 23 + Allegiances.GetHashCode();
            hash = hash * 23 + Books.GetHashCode();
            hash = hash * 23 + PovBooks.GetHashCode();
            hash = hash * 23 + PlayedBy.GetHashCode();
            hash = hash * 23 + TvSeries.GetHashCode();

            return(hash);
        }
 public override int GetHashCode()
 {
     return(Father?.GetHashCode() ?? 0);
 }