diff --git a/Blog.Core.Repository/BASE/IBaseRepository.cs b/Blog.Core.Repository/BASE/IBaseRepository.cs index d1f6c43..bcf9830 100644 --- a/Blog.Core.Repository/BASE/IBaseRepository.cs +++ b/Blog.Core.Repository/BASE/IBaseRepository.cs @@ -10,31 +10,117 @@ namespace Blog.Core.IRepository.Base { public interface IBaseRepository where TEntity : class { - + /// + /// 根据Id查询实体 + /// + /// + /// Task QueryById(object objId); Task QueryById(object objId, bool blnUseCache = false); + /// + /// 根据id数组查询实体list + /// + /// + /// Task> QueryByIDs(object[] lstIds); - + + /// + /// 添加 + /// + /// + /// Task Add(TEntity model); + /// + /// 批量添加 + /// + /// + /// Task Add(List listEntity); + /// + /// 根据id 删除某一实体 + /// + /// + /// Task DeleteById(object id); + /// + /// 根据对象,删除某一实体 + /// + /// + /// Task Delete(TEntity model); + /// + /// 根据id数组,删除实体list + /// + /// + /// Task DeleteByIds(object[] ids); + /// + /// 更新model + /// + /// + /// Task Update(TEntity model); + + /// + /// 根据model,更新,带where条件 + /// + /// + /// + /// Task Update(TEntity entity, string strWhere); Task Update(object operateAnonymousObjects); + /// + /// 根据model,更新,指定列 + /// + /// + /// + /// + /// + /// Task Update(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string strWhere = ""); + /// + /// 查询 + /// + /// Task> Query(); + + /// + /// 带sql where查询 + /// + /// + /// Task> Query(string strWhere); + + /// + /// 根据表达式查询 + /// + /// + /// Task> Query(Expression> whereExpression); + + /// + /// 根据表达式,指定返回对象模型,查询 + /// + /// + /// + /// Task> Query(Expression> expression); + + /// + /// 根据表达式,指定返回对象模型,排序,查询 + /// + /// + /// + /// + /// + /// Task> Query(Expression> expression, Expression> whereExpression, string strOrderByFileds); Task> Query(Expression> whereExpression, string strOrderByFileds); Task> Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true); @@ -49,12 +135,74 @@ namespace Blog.Core.IRepository.Base Expression> whereExpression, int intPageIndex, int intPageSize, string strOrderByFileds); Task> Query(string strWhere, int intPageIndex, int intPageSize, string strOrderByFileds); - + /// + /// 根据表达式,排序字段,分页查询 + /// + /// + /// + /// + /// + /// Task> QueryPage(Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null); + /// + /// 三表联查 + /// + /// + /// + /// + /// + /// + /// + /// + /// Task> QueryMuch( Expression> joinExpression, Expression> selectExpression, Expression> whereLambda = null) where T : class, new(); + + /// + /// 两表联查-分页 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task> QueryTabsPage( + Expression> joinExpression, + Expression> selectExpression, + Expression> whereExpression, + int intPageIndex = 1, + int intPageSize = 20, + string strOrderByFileds = null); + + /// + /// 两表联合查询-分页-分组 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task> QueryTabsPage( + Expression> joinExpression, + Expression> selectExpression, + Expression> whereExpression, + Expression> groupExpression, + int intPageIndex = 1, + int intPageSize = 20, + string strOrderByFileds = null); } }