using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Ropin.Inspection.Repository
{
    public interface IRepositoryBase<T>
    {
        IEnumerable<T> GetAll();
        Task<IEnumerable<T>> GetAllAsync();

        Task<IEnumerable<T>> GetByConditionAsync(Expression<Func<T, bool>> expression);

        void Create(T entity);
        Task CreateOneAsync(T entity);

        void Update(T entity);
        //Task<bool> UpdateOneAsync(T entity);

        void Delete(T entity);
        //Task<bool> DeleteOneAsync(T entity);
        Task<int> RemoveAsync(T entity);
        Task<int> RemoveRangeAsync(IEnumerable<T> entities);

        Task<bool> SaveAsync();
        Task<int> CreateRangeAsync(IEnumerable<T> entities);
        Task<PageData<T>> GetPageAsync(Expression<Func<T, bool>> whereLambda, string ordering,bool IsPagination, int pageIndex, int pageSize, bool isNoTracking = true);
    }
}