using Microsoft.Data.SqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Back.Data.Contracts
{ 
    public interface IAsyncRepository<T>
    {
        IQueryable<T> GetAll();
        IQueryable<T> TrackingGet(Expression<Func<T, bool>> predicate);
        IQueryable<T> Get(Expression<Func<T, bool>> predicate);
        IQueryable<T> Get(Expression<Func<T, bool>> predicate = null,
                                        Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
                                        string[] includeSrings = null,
                                        bool disableTracking = true);

        IQueryable<T> Get(Expression<Func<T, bool>> predicate = null,
                                        Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
                                        List<Expression<Func<T, object>>> includes = null,
                                        bool disableTracking = true);
        Task<bool> AddRangeAsync(ICollection<T> entites);
        Task<T> AddAsync(T entity);
        T? Add(T entity);
        Task<bool> AddBoolResultAsync(T entity);
        bool AddBoolResult(T entity);
        Task<bool> UpdateAsync(T entity);
        bool Update(T entity);
        Task<T?> UpdateByObjAsync(T entity);
        T? UpdateByObj(T entity);
        Task<bool> UpdateRangeAsync(ICollection<T> entites);
        bool UpdateRange(ICollection<T> entites);
        bool Delete(T entity);
        Task<bool> DeleteRangeAsync(ICollection<T> entites);
        Task<bool> DeleteAsync(T entity);
        Task<List<SqlParameter>> RunSP(string query, List<SqlParameter> parameters);
       Task ExecuteSql(string query);
    }
}
