MongoDB.Driver.Document.GetHashCode C# (CSharp) Method

GetHashCode() public method

public GetHashCode ( ) : int
return int
        public override int GetHashCode()
        {
            int hash = 27;
            foreach (var key in orderedKeys) {
                var valueHashCode = GetValueHashCode(this[key]);
                unchecked {
                    hash = (13 * hash) + key.GetHashCode();
                    hash = (13 * hash) + valueHashCode;
                }
            }
            return hash;
        }

Usage Example

Esempio n. 1
0
 public bool Equals(Document obj)
 {
     if (obj == null)
     {
         return(false);
     }
     if (orderedKeys.Count != obj.orderedKeys.Count)
     {
         return(false);
     }
     return(this.GetHashCode() == obj.GetHashCode());
 }
All Usage Examples Of MongoDB.Driver.Document::GetHashCode