using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using SqlSugar; using XF.Domain.Entities; namespace XF.Domain.Repository { public interface IRepositorySqlSugar : IRepositoryWithTKey where TEntity : class, IEntity, new() { Task<(int Total, List Items)> QueryPagedAsync( Expression> predicate, Func, ISugarQueryable> orderByCreator, int pageIndex, int pageSize, bool permissionVerify = false, params (bool isWhere, Expression> expression)[] whereIfs); Task<(int Total, List Items)> QueryPagedAsync(Expression> predicate, int pageIndex, int pageSize, Func, ISugarQueryable>? includes = null, Func, ISugarQueryable>? orderByCreator = null, bool permissionVerify = false, params (bool isWhere, Expression> expression)[] whereIfs); Task> QueryExtAsync( Expression> predicate, Func, ISugarQueryable>? includes = null, Func, ISugarQueryable>? orderByCreator = null, bool permissionVerify = false, params (bool isWhere, Expression> expression)[] whereIfs); Task> QueryExtAsync( Expression> predicate, Func, ISugarQueryable> includes, bool permissionVerify = false); Task GetExtAsync( Expression> predicate, Func, ISugarQueryable> includes, bool permissionVerify = false); Task GetExtAsync( TKey id, Func, ISugarQueryable> includes, bool permissionVerify = false); TEntity Get(TKey id); TEntity Get(Expression> predicate); Task UpdateAsync(TEntity entity, bool ignoreNullColumns = true, CancellationToken cancellationToken = default); ISugarQueryable Queryable(bool permissionVerify = false, bool includeDeleted = false); IUpdateable Updateable(); IUpdateable Updateable(TEntity entity); IUpdateable Updateable(List entities); IDeleteable Removeable(); UpdateNavTaskInit UpdateNav(TEntity entity); UpdateNavTaskInit UpdateNav(TEntity entity, UpdateNavRootOptions options); UpdateNavTaskInit UpdateNav(List entities); UpdateNavTaskInit UpdateNav(List entities, UpdateNavRootOptions options); /// /// 未实现统一为子表赋值creatorId, creatorOrg等字段,插入前需手动赋值 /// InsertNavTaskInit AddNav(TEntity entity); InsertNavTaskInit AddNav(TEntity entity, InsertNavRootOptions options); /// /// 未实现统一为子表赋值creatorId, creatorOrg等字段,插入前需手动赋值 /// InsertNavTaskInit AddNav(List entities); InsertNavTaskInit AddNav(List entities, InsertNavRootOptions options); DeleteNavTaskInit RemoveNav(TEntity entity); DeleteNavTaskInit RemoveNav(List entities); DeleteNavTaskInit RemoveNav(Expression> predicate); ISugarQueryable UnionAll(params ISugarQueryable[] queryables); } public interface IRepositorySqlSugar : IRepositorySqlSugar where TEntity : class, IEntity, new() { } }