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); }
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 { }); }
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); }
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; }
public MessageBusiness(IMongoDB <Message> mongoDB) { _mongoDB = mongoDB; }
public GuildBusiness(IMongoDB <Guild> mongoDB) { _mongoDB = mongoDB; }
public CartOperationService(IMongoDB <Product> product) { _product = product; _redisProvider = new RedisProvider(); }
public void Dispose() { _mongoDB = null; }
public LiveUserStore(IGoogleAPIs googleAPIs, IMongoDB mongoDB) { _googleAPIs = googleAPIs; _collection = mongoDB.GetUserCollection(); }
public CustomersRepository(IMongoDB service, string collectionName) { this.service = service; this.collectionName = collectionName; }
public PlayerBusiness(IMongoDB <Player> mongoDB) { _mongoDB = mongoDB; }
public NotificationRepository(IMongoDB mongoDB) : base(mongoDB) { }
public HomeController(ICloudOrders cloudOrders, IMongoDB mongoDB) { _cloudOrders = cloudOrders; _mongoDB = mongoDB; }