
using MongoDB.Driver;
using Tiobon.Core.Common;

namespace Tiobon.Core.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<TEntity> Query
    //{
    //    get
    //    {
    //        return _database.GetCollection<TEntity>(nameof(TEntity));
    //    }
    //}
}
