public BaseGridFsFileRepository(IMongoClientContext mongoClientcontext)
        {
            mongoClient   = mongoClientcontext.getContext();
            mongoDatabase = mongoClientcontext.getDatabase();

            gridFsBucket = new GridFSBucket(mongoDatabase);
        }
Beispiel #2
0
        public BaseImageRepository(IMongoClientContext mongoClientContext)
        {
            mongoClient   = mongoClientContext.getContext();
            mongoDatabase = mongoClientContext.getDatabase();
            string collection = AttributeFinder.GetAttributeValue <T, MongoTable, string>(z => z.Name);

            if (String.IsNullOrEmpty(collection))
            {
                throw new Exception(Errors.UNDEFINED_COLLECTION);
            }

            Items = mongoDatabase.GetCollection <T>(collection);
        }