using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; namespace SqlSugar { public interface ISimpleClient where T : class, new() { RepositoryType CopyNew() where RepositoryType : ISugarRepository; SimpleClient Change() where ChangeType : class, new(); RepositoryType ChangeRepository() where RepositoryType : ISugarRepository ; IDeleteable AsDeleteable(); IInsertable AsInsertable(List insertObjs); IInsertable AsInsertable(T insertObj); IInsertable AsInsertable(T[] insertObjs); ISugarQueryable AsQueryable(); ISqlSugarClient AsSugarClient(); ITenant AsTenant(); IUpdateable AsUpdateable(List updateObjs); IUpdateable AsUpdateable(T updateObj); IUpdateable AsUpdateable(); IUpdateable AsUpdateable(T[] updateObjs); int Count(Expression> whereExpression); bool Delete(Expression> whereExpression); bool Delete(T deleteObj); bool Delete(List deleteObjs); bool DeleteById(dynamic id); bool DeleteByIds(dynamic[] ids); T GetById(dynamic id); List GetList(); List GetList(Expression> whereExpression); List GetPageList(Expression> whereExpression, PageModel page); List GetPageList(Expression> whereExpression, PageModel page, Expression> orderByExpression = null, OrderByType orderByType = OrderByType.Asc); List GetPageList(List conditionalList, PageModel page); List GetPageList(List conditionalList, PageModel page, Expression> orderByExpression = null, OrderByType orderByType = OrderByType.Asc); T GetSingle(Expression> whereExpression); T GetFirst(Expression> whereExpression); bool Insert(T insertObj); bool InsertOrUpdate(T data); bool InsertOrUpdate(List datas); bool InsertRange(List insertObjs); bool InsertRange(T[] insertObjs); int InsertReturnIdentity(T insertObj); long InsertReturnBigIdentity(T insertObj); long InsertReturnSnowflakeId(T insertObj); List InsertReturnSnowflakeId(List insertObjs); T InsertReturnEntity(T insertObj); bool IsAny(Expression> whereExpression); bool Update(Expression> columns, Expression> whereExpression); bool UpdateSetColumnsTrue(Expression> columns, Expression> whereExpression); bool Update(T updateObj); bool UpdateRange(List updateObjs); bool UpdateRange(T[] updateObjs); Task CountAsync(Expression> whereExpression); Task DeleteAsync(Expression> whereExpression); Task DeleteAsync(T deleteObj); Task DeleteAsync(List deleteObjs); Task DeleteByIdAsync(dynamic id); Task DeleteByIdsAsync(dynamic[] ids); Task GetByIdAsync(dynamic id); Task> GetListAsync(); Task> GetListAsync(Expression> whereExpression); Task> GetPageListAsync(Expression> whereExpression, PageModel page); Task> GetPageListAsync(Expression> whereExpression, PageModel page, Expression> orderByExpression = null, OrderByType orderByType = OrderByType.Asc); Task> GetPageListAsync(List conditionalList, PageModel page); Task> GetPageListAsync(List conditionalList, PageModel page, Expression> orderByExpression = null, OrderByType orderByType = OrderByType.Asc); Task GetSingleAsync(Expression> whereExpression); Task GetFirstAsync(Expression> whereExpression); Task InsertAsync(T insertObj); Task InsertOrUpdateAsync(T data); Task InsertOrUpdateAsync(List datas); Task InsertRangeAsync(List insertObjs); Task InsertRangeAsync(T[] insertObjs); Task InsertReturnIdentityAsync(T insertObj); Task InsertReturnBigIdentityAsync(T insertObj); Task InsertReturnSnowflakeIdAsync(T insertObj); Task> InsertReturnSnowflakeIdAsync(List insertObjs); Task InsertReturnEntityAsync(T insertObj); Task IsAnyAsync(Expression> whereExpression); Task UpdateSetColumnsTrueAsync(Expression> columns, Expression> whereExpression); Task UpdateAsync(Expression> columns, Expression> whereExpression); Task UpdateAsync(T updateObj); Task UpdateRangeAsync(List updateObjs); Task UpdateRangeAsync(T[] updateObjs); } }