Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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;
        }