예제 #1
0
 public bool Equals(HelloRequest other)
 {
     if (ReferenceEquals(other, null))
     {
         return(false);
     }
     if (ReferenceEquals(other, this))
     {
         return(true);
     }
     if (Name != other.Name)
     {
         return(false);
     }
     if (Age != other.Age)
     {
         return(false);
     }
     if (!hobbies_.Equals(other.hobbies_))
     {
         return(false);
     }
     if (!BagOfTricks.Equals(other.BagOfTricks))
     {
         return(false);
     }
     if (Sentiment != other.Sentiment)
     {
         return(false);
     }
     return(true);
 }
예제 #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Age != 0)
            {
                hash ^= Age.GetHashCode();
            }
            hash ^= hobbies_.GetHashCode();
            hash ^= BagOfTricks.GetHashCode();
            if (Sentiment != 0)
            {
                hash ^= Sentiment.GetHashCode();
            }
            return(hash);
        }