public BaseRepository(IDbService dbService) { // TODO: Check if the client object can be made static, and avoid many open and closures. db = dbService.GetDatabase(); MongoClient = dbService.GetClient(); this.CollectionName = CollectionNameAttribute.GetCollectionName <T>(); this.Collection = GetCollection(); this.QuerableCollection = this.Collection.AsQueryable <T>(); }
static DbService() { MongoClient = new MongoDBClient(); Database = MongoClient.GetConnection(MongoDBSettings.DBConnectionString, MongoDBSettings.DatabaseName); }
public UserRepository(IMongoDBClient mongoDbClient) { _mongoDbClient = mongoDbClient; }
public MongoDBRepository(IMongoDBClient client) { _db = client.GetDatabase(); }