GetHashCode() публичный Метод

Hashcode override
public GetHashCode ( ) : int
Результат int
Пример #1
0
 /// <summary>
 /// Equals override
 /// </summary>
 /// <param name="obj">The object to compare against</param>
 /// <returns>True if equal</returns>
 public override bool Equals(object obj)
 {
     if (obj is SentimentResponse)
     {
         SentimentResponse other      = obj as SentimentResponse;
         List <bool>       conditions = new List <bool>()
         {
             this.DocSentiment != null && other.DocSentiment != null?this.DocSentiment.Equals(other.DocSentiment) : this.DocSentiment == other.DocSentiment,
             this.EntitySentiments != null && other.EntitySentiments != null?this.EntitySentiments.SequenceEqual(other.EntitySentiments) : this.EntitySentiments == other.EntitySentiments,
                 this.ResponseHeaders != null && other.ResponseHeaders != null?this.ResponseHeaders.Equals(other.ResponseHeaders) : this.ResponseHeaders == other.ResponseHeaders,
                     this.GetHashCode() == other.GetHashCode()
         };
         return(conditions.All(condition => condition));
     }
     else
     {
         return(false);
     }
 }