Exemple #1
0
        static IMongoDatabase GetDatabase(MongoDbOptions dbOptions)
        {
            var client = new MongoClient(dbOptions.ConnectionString);

            return(client.GetDatabase(dbOptions.Database));
        }
Exemple #2
0
 public MgDeveloperRepository(IOptions <MongoDbOptions> mongoDbOptions, ILogger <MgDeveloperRepository> logger)
 {
     _mongoDbOptions = mongoDbOptions?.Value ?? throw new ArgumentNullException(nameof(mongoDbOptions));
     _logger         = logger ?? throw new ArgumentNullException(nameof(logger));
 }