In the old API (1.X) you could tell whether the server was connected or not by using the State
property on the MongoServer
instance returned from MongoClient.GetServer
:
public bool IsConnceted
{
get
{
return _client.GetServer().State == MongoServerState.Connected;
}
}
However GetServer
is not a part of the new API (2.0). How can that be achieved?