/// <summary>
        ///   Adds the server.
        /// </summary>
        /// <param name = "endPoint">The end point.</param>
        public void AddServer(MongoServerEndPoint endPoint)
        {
            if (endPoint == null)
            {
                throw new ArgumentNullException("endPoint");
            }

            this.servers.Add(endPoint);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <param name="other">An object to compare with this object.</param>
 /// <returns>
 /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
 /// </returns>
 public bool Equals(MongoServerEndPoint other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.Host, this.Host) && other.Port == this.Port);
 }