GetServer
is part of the old API.
To use the new, shiny and async
-ready API simply call GetDatabase
directly on the client to get an IMongoDatabase
and GetCollection
on it to get an IMongoCollection
:
var db = client.GetDatabase("HamsterSchool");
var collection = db.GetCollection<Hamster>("Hamsters");
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…