namespace e_suite.Database.Core;

public class RepositoryBase : IRepository
{
    protected readonly IEsuiteDatabaseDbContext DatabaseDbContext;

    public RepositoryBase(IEsuiteDatabaseDbContext databaseDbContext)
    {
        DatabaseDbContext = databaseDbContext;
    }

    public async Task<T> TransactionAsync<T>(Func<Task<T>> func)
    {
        return await DatabaseDbContext.TransactionAsync(func);
    }

    public async Task TransactionAsync(Func<Task> action)
    {
        await DatabaseDbContext.TransactionAsync(action);
    }
}