| | |
| | | return db; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建数据库连接对象 |
| | | /// </summary> |
| | | public ISqlSugarClient Db => _db; |
| | | |
| | | public RepositoryBase(IUnitOfWorkManage unitOfWorkManage) |
| | |
| | | public virtual int AddData(List<TEntity> listEntity) |
| | | { |
| | | IInsertable<TEntity> insert = _db.Insertable(listEntity); |
| | | return insert.ExecuteReturnIdentity(); |
| | | return insert.ExecuteCommand(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | orderByModels.Add(orderByModel); |
| | | } |
| | | int totalCount = 0; |
| | | List<TEntity> list = _db.Queryable<TEntity>() |
| | | .WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).ToPageList(pageIndex, pageSize, ref totalCount); |
| | | List<TEntity> list = _db.Queryable<TEntity>().OrderBy(orderByModels) |
| | | .WhereIF(!string.IsNullOrEmpty(where), where).ToPageList(pageIndex, pageSize, ref totalCount); |
| | | |
| | | return new PageGridData<TEntity>(totalCount, list); |
| | | } |