Пример #1
0
        public PriceService(IConfiguration config, IMongoDB settings)
        {
            var server   = new MongoClient(config.GetSection("MongoDB").GetSection("ConnectionString").Value);
            var database = server.GetDatabase(config.GetSection("MongoDB").GetSection("Database").Value);

            _prices = database.GetCollection <Price>(config.GetSection("MongoDB").GetSection("PricesCollectionName").Value);
        }
Пример #2
0
        public MongoRepository(IMongoDB mongoDB)
        {
            string collectionName = Regex.Replace(typeof(TEntity).Name, "[^a-zA-Z]+", "").ToLower().Replace("entidade", "");

            this._mongoCollection = mongoDB.GetDatabase().GetCollection <TEntity>(collectionName, new MongoCollectionSettings {
            });
        }
Пример #3
0
        public SupermarketBrandService(IConfiguration config, IMongoDB settings)
        {
            var server   = new MongoClient(config.GetSection("MongoDB").GetSection("ConnectionString").Value);
            var database = server.GetDatabase(config.GetSection("MongoDB").GetSection("Database").Value);

            _supermarketBrands = database.GetCollection <SupermarketBrand>(config.GetSection("MongoDB").GetSection("SupermarketBrandsCollectionName").Value);
        }
Пример #4
0
        private void OpenSession()
        {
            if (_mongoDB == null)
            {
                _mongoDB = new MongoDB();
            }

            if (_mongoDB.Client == null)
            {
                var host = ConfigurationManager.AppSettings["DatabaseHost"];
                var port = ConfigurationManager.AppSettings["DatabasePort"];

                MongoClientSettings setting = new MongoClientSettings();
                setting.Server  = new MongoServerAddress(host, int.Parse(port));
                _mongoDB.Client = new MongoClient(setting);

                _mongoDB.InitDatabase();
            }
        }
 public MovieController(IMongoDB <Movie> mongoDB)
 {
     _mongoClient = mongoDB;
 }
Пример #6
0
 public MessageBusiness(IMongoDB <Message> mongoDB)
 {
     _mongoDB = mongoDB;
 }
Пример #7
0
 public GuildBusiness(IMongoDB <Guild> mongoDB)
 {
     _mongoDB = mongoDB;
 }
 public CartOperationService(IMongoDB <Product> product)
 {
     _product       = product;
     _redisProvider = new RedisProvider();
 }
Пример #9
0
 public void Dispose()
 {
     _mongoDB = null;
 }
Пример #10
0
 public LiveUserStore(IGoogleAPIs googleAPIs, IMongoDB mongoDB)
 {
     _googleAPIs = googleAPIs;
     _collection = mongoDB.GetUserCollection();
 }
Пример #11
0
 public CustomersRepository(IMongoDB service, string collectionName)
 {
     this.service        = service;
     this.collectionName = collectionName;
 }
Пример #12
0
 public PlayerBusiness(IMongoDB <Player> mongoDB)
 {
     _mongoDB = mongoDB;
 }
Пример #13
0
 public NotificationRepository(IMongoDB mongoDB)
     : base(mongoDB)
 {
 }
Пример #14
0
 public HomeController(ICloudOrders cloudOrders, IMongoDB mongoDB)
 {
     _cloudOrders = cloudOrders;
     _mongoDB     = mongoDB;
 }