Esempio n. 1
0
        public MongoDataSource(IAgaMongoServer mongoServer, DatasourceParams datasourceParams)
        {
            var database = mongoServer.Server.GetDatabase(datasourceParams.DatabaseName);

            if (!database.CollectionExists(datasourceParams.CollectionName))
            {
                database.CreateCollection(datasourceParams.CollectionName);
            }
            _collection = database.GetCollection <T>(datasourceParams.CollectionName);
        }
Esempio n. 2
0
        public MongoDataSource(IAgaMongoServer mongoServer, DatasourceParams datasourceParams)
        {
            var database = mongoServer.Server.GetDatabase(datasourceParams.DatabaseName);

            _collection = database.GetCollection <T>(datasourceParams.CollectionName);
        }