public BaseGridFsFileRepository(IMongoClientContext mongoClientcontext) { mongoClient = mongoClientcontext.getContext(); mongoDatabase = mongoClientcontext.getDatabase(); gridFsBucket = new GridFSBucket(mongoDatabase); }
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); }