using Microsoft.EntityFrameworkCore.Storage;

namespace Lada.Framework.Data.Repositories
{
    public interface IRepository<T> where T : class 
    {

        IQueryable<T> Query();
        IQueryable<T> QueryAll();

        IDbContextTransaction BeginTransaction();

        Task<int> InsertAsync(T entity);
        Task<int> InsertAsync(IEnumerable<T> entities);
        Task<int> UpdateAsync(T entity);
        Task<int> UpdateAsync(IEnumerable<T> entities);
        T GetById(object id);
        Task<T> GetByIdAsync(object id);
        void InsertMany(IEnumerable<T> entities);
        Task<int> InsertManyAsync(IEnumerable<T> entity);

        Task<int> DeleteAsync(T entity);
        Task<int> DeleteAsync(IEnumerable<T> entities);


        Task<int> RemoveAsync(T entity);
        Task<int> RemoveAsync(IEnumerable<T> entities);
        
    }
}
