public MeasurementService(IAirQualityDatabaseSettings settings) { var client = new MongoClient(settings.ConnectionString); var database = client.GetDatabase(settings.DatabaseName); _measurements = database.GetCollection <Measurements>(settings.MeasurementCollectionName); }
public AirQualityContext(IAirQualityDatabaseSettings setting) { _setting = setting; var client = new MongoClient(setting.ConnectionString); if (client != null) { _database = client.GetDatabase(setting.DatabaseName); } }