using EntrustSettle.Common; using MongoDB.Driver; namespace EntrustSettle.Repository.MongoRepository { public class MongoDbContext { private readonly IMongoDatabase _database = null; public MongoDbContext() { var client = new MongoClient(AppSettings.app(new string[] { "Mongo", "ConnectionString" })); _database = client.GetDatabase(AppSettings.app(new string[] { "Mongo", "Database" })); } public IMongoDatabase Db { get { return _database; } } //public IMongoCollection Query //{ // get // { // return _database.GetCollection(nameof(TEntity)); // } //} } }