mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-26 13:43:10 +08:00
Update SimpleClient
This commit is contained in:
@@ -32,6 +32,13 @@ namespace SqlSugar
|
||||
{
|
||||
return Context.Queryable<T>().Where(whereExpression).ToList();
|
||||
}
|
||||
public List<T> GetPageList<T>(Expression<Func<T, bool>> whereExpression,PageModel page) where T : class, new()
|
||||
{
|
||||
int count = 0;
|
||||
var result= Context.Queryable<T>().Where(whereExpression).ToPageList(page.PageIndex,page.PageSize,ref count);
|
||||
page.PageCount = count;
|
||||
return result;
|
||||
}
|
||||
public bool Insert<T>(T insertObj) where T : class, new()
|
||||
{
|
||||
return this.Context.Insertable(insertObj).ExecuteCommand() > 0;
|
||||
@@ -99,6 +106,13 @@ namespace SqlSugar
|
||||
{
|
||||
return Context.Queryable<T>().Where(whereExpression).ToList();
|
||||
}
|
||||
public List<T> GetPageList(Expression<Func<T, bool>> whereExpression, PageModel page)
|
||||
{
|
||||
int count = 0;
|
||||
var result = Context.Queryable<T>().Where(whereExpression).ToPageList(page.PageIndex, page.PageSize, ref count);
|
||||
page.PageCount = count;
|
||||
return result;
|
||||
}
|
||||
public bool Insert(T insertObj)
|
||||
{
|
||||
return this.Context.Insertable(insertObj).ExecuteCommand() > 0;
|
||||
|
||||
Reference in New Issue
Block a user