|
|
|
@ -29,6 +29,12 @@ public abstract class BaseRepository<T> where T : class, new()
|
|
|
|
|
.InSingle(pkValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ISugarQueryable<T> Queryable(bool blUseNoLock = false)
|
|
|
|
|
{
|
|
|
|
|
return DbBaseClient
|
|
|
|
|
.Queryable<T>().WithNoLockOrNot(blUseNoLock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据主值查询单条数据
|
|
|
|
|
/// </summary>
|
|
|
|
@ -109,7 +115,7 @@ public abstract class BaseRepository<T> where T : class, new()
|
|
|
|
|
.Queryable<T>()
|
|
|
|
|
.Where(predicate)
|
|
|
|
|
.WithNoLockOrNot(false)
|
|
|
|
|
.ToPageList(page.Page, page.PageSize, ref totalCount);
|
|
|
|
|
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -135,7 +141,7 @@ public abstract class BaseRepository<T> where T : class, new()
|
|
|
|
|
.Queryable<T>()
|
|
|
|
|
.Where(predicate)
|
|
|
|
|
.WithNoLockOrNot(false)
|
|
|
|
|
.ToPageListAsync(page.Page, page.PageSize, totalCount);
|
|
|
|
|
.ToPageListAsync(page.PageNum, page.PageSize, totalCount);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -159,7 +165,7 @@ public abstract class BaseRepository<T> where T : class, new()
|
|
|
|
|
List<T> pageList = DbBaseClient
|
|
|
|
|
.Queryable<T>()
|
|
|
|
|
.WithNoLockOrNot(false)
|
|
|
|
|
.ToPageList(page.Page, page.PageSize, ref totalCount);
|
|
|
|
|
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
|
|
|
|
|
|
|
|
|
|
return new IPage<T>(totalCount, page, pageList);
|
|
|
|
|
}
|
|
|
|
@ -176,7 +182,7 @@ public abstract class BaseRepository<T> where T : class, new()
|
|
|
|
|
List<T> pageList = await DbBaseClient
|
|
|
|
|
.Queryable<T>()
|
|
|
|
|
.WithNoLockOrNot(false)
|
|
|
|
|
.ToPageListAsync(page.Page, page.PageSize, totalCount);
|
|
|
|
|
.ToPageListAsync(page.PageNum, page.PageSize, totalCount);
|
|
|
|
|
|
|
|
|
|
return new IPage<T>(totalCount, page, pageList);
|
|
|
|
|
}
|
|
|
|
|