using System;
using System.Data;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace IRaCIS.Core.Infra.EFCore
{
    public interface IEFUnitOfWork<out TDbContext> :IDisposable where TDbContext : DbContext
    {
        DbContext DbContext { get; }


        void BeginTransaction(IsolationLevel isolationLevel= IsolationLevel.ReadCommitted);

        Task BeginTransactionAsync(IsolationLevel isolationLevel = IsolationLevel.ReadCommitted);

        void Commit();
        Task CommitAsync(CancellationToken cancellationToken);

    }
}
