示例#1
0
        public DemoService(IDemoDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _demo = database.GetCollection <Demo>(settings.DemoCollectionName);
        }
示例#2
0
        public ProductService(IDemoDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _products = database.GetCollection <Product>(settings.ProductCollectionName);
        }