Created
July 11, 2020 15:19
-
-
Save zleao/fe3c78b2dad1f098d13f1bb2e3af750b to your computer and use it in GitHub Desktop.
Code necessary to create a databse using the MongoDB.Driver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IMongoDatabase GetDatabaseInstance() | |
{ | |
var settings = MongoClientSettings.FromUrl(new MongoUrl(Configuration.ConnectionString)); | |
settings.SslSettings = new SslSettings() { EnabledSslProtocols = SslProtocols.Tls12 }; | |
var client = new MongoClient(settings); | |
return client.GetDatabase(Configuration.DatabaseName); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment