using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; using SqlSugar; using WMS.Entity; namespace WMS.IDAL { public interface IBaseRepository where T : BaseEntity { int Add(T t); Task AddAsync(T t); int Edit(T t); Task EditAsync(T t); int Remove(int id,int userId = 0); Task RemoveAsync(int id ,int userId = 0); int Remove(T t,int userId = 0); Task RemoveAsync(T t, int userId = 0); int RemoveAll(List t, int userId = 0); Task RemoveAllAsync(List t,int userId = 0); void Save(); Task SaveAsync(); ISugarQueryable GetAllAsync(); T GetOneById(int id); Task GetOneByIdAsync(int id); List GetModels(string sqlString); T GetModel(string sqlString); ISugarQueryable GetAllWhereAsync(Expression> predicate); ISugarQueryable GeTAllByPageAsync(Expression> predicate,int pageSize,int pageIndex, out int count); ISugarQueryable GetAllByOrderAsync(Expression> predicate, bool asc = true); ISugarQueryable GetAllByOrderPageAsync(Expression> predicate, int pageSize , int pageIndex , out int count,bool asc = true); } }