MongoDB.Mongo.ShutdownServer C# (CSharp) Method

ShutdownServer() public method

public ShutdownServer ( ) : void
return void
        public void ShutdownServer()
        {
            try
              {
            AdminCommand("shutdown");
              }
              catch (MongoException ex)
              {
            //this is the desired path
            if (ex.Message.Equals("Server connection failed"))
              return; //server should be down
              }
              throw new MongoException("ShutdownServer failed");
        }