Browse Source

Update SimpleClient

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
8a63ff5b34
  1. 14
      Src/Asp.Net/SqlSugar/SimpleClient.cs

14
Src/Asp.Net/SqlSugar/SimpleClient.cs

@ -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;

Loading…
Cancel
Save