public CustomerService(ICustomerDbSettings settings) { var client = new MongoClient(settings.ConnectionString); var database = client.GetDatabase(settings.DatabaseName); _customers = database.GetCollection <Customer>(settings.CollectionName); }
public CustomerDb(ICustomerDbSettings customerDbSettings) { var client = new MongoClient(customerDbSettings.ConnectionString); var database = client.GetDatabase(customerDbSettings.DatabaseName); _customers = database.GetCollection <Models.Customer>(customerDbSettings.CollectionName); }