public ProductRepository(IMongoClient mongoClient, IMongoDatabaseSettings <Product> mongoDatabaseSettings) { var databaseName = mongoDatabaseSettings.GetDatabaseName(); var collectionName = mongoDatabaseSettings.GetCollectionName(); var database = mongoClient.GetDatabase(databaseName); _productCollection = database.GetCollection <Product>(collectionName); }
public CategoryRepository(IMongoClient mongoClient, IMongoDatabaseSettings <Genre> mongoDatabaseSettings) { var databaseName = mongoDatabaseSettings.GetDatabaseName(); var collectionName = mongoDatabaseSettings.GetCollectionName(); var database = mongoClient.GetDatabase(databaseName); _genreCollection = database.GetCollection <Genre>(collectionName); }
public PublisherRepository(IMongoDatabaseSettings <Publisher> mongoDatabaseSettings, IMongoClient mongoClient) { var databaseName = mongoDatabaseSettings.GetDatabaseName(); var collectionName = mongoDatabaseSettings.GetCollectionName(); var database = mongoClient.GetDatabase(databaseName); _publishersCollection = database.GetCollection <Publisher>(collectionName); }
public ShipperRepository(IMongoDatabaseSettings <Shipper> mongoDatabaseSettings, IMongoClient mongoClient) { var databaseName = mongoDatabaseSettings.GetDatabaseName(); var collectionName = mongoDatabaseSettings.GetCollectionName(); var database = mongoClient.GetDatabase(databaseName); _shipperCollection = database.GetCollection <Shipper>(collectionName); }
public Logger(IMongoDatabaseSettings <BaseLogEntry> mongoDatabaseSettings, IMongoClient mongoClient) { var databaseName = mongoDatabaseSettings.GetDatabaseName(); var collectionName = mongoDatabaseSettings.GetCollectionName(); var database = mongoClient.GetDatabase(databaseName); _logsCollection = database.GetCollection <BaseLogEntry>(collectionName); }
public OrderDetailsRepository( IMongoClient mongoClient, IMongoDatabaseSettings <OrderDetails> mongoDatabaseSettings) { var databaseName = mongoDatabaseSettings.GetDatabaseName(); var collectionName = mongoDatabaseSettings.GetCollectionName(); var database = mongoClient.GetDatabase(databaseName); _orderDetailsCollection = database.GetCollection <OrderDetails>(collectionName); }
public OrderRepository( IMongoDatabaseSettings <Order> mongoDatabaseSettings, IMongoClient mongoClient, IAsyncReadonlyRepository <OrderDetails> orderDetailsRepository, IProductRepository productRepository, IMapper mapper) { var databaseName = mongoDatabaseSettings.GetDatabaseName(); var collectionName = mongoDatabaseSettings.GetCollectionName(); var database = mongoClient.GetDatabase(databaseName); _ordersCollection = database.GetCollection <Order>(collectionName); _orderDetailsRepository = orderDetailsRepository; _productRepository = productRepository; _mapper = mapper; }