Ejemplo n.º 1
0
        static IMongoDatabase GetDatabase(MongoDbOptions dbOptions)
        {
            var client = new MongoClient(dbOptions.ConnectionString);

            return(client.GetDatabase(dbOptions.Database));
        }
Ejemplo n.º 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));
 }