예제 #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);
        }
예제 #2
0
        public MongoDataSource(IAgaMongoServer mongoServer, DatasourceParams datasourceParams)
        {
            var database = mongoServer.Server.GetDatabase(datasourceParams.DatabaseName);

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