mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-31 15:56:25 +08:00
SimpleClient Add Count Method
This commit is contained in:
parent
9a462981dd
commit
8c08fa5cc1
@ -24,6 +24,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return Context.Queryable<T>().InSingle(id);
|
return Context.Queryable<T>().InSingle(id);
|
||||||
}
|
}
|
||||||
|
public int Count<T>(Expression<Func<T, bool>> whereExpression)
|
||||||
|
{
|
||||||
|
return Context.Queryable<T>().Where(whereExpression).Count();
|
||||||
|
}
|
||||||
public List<T> GetList<T>() where T : class, new()
|
public List<T> GetList<T>() where T : class, new()
|
||||||
{
|
{
|
||||||
return Context.Queryable<T>().ToList();
|
return Context.Queryable<T>().ToList();
|
||||||
@ -172,6 +176,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return Context.Queryable<T>().ToList();
|
return Context.Queryable<T>().ToList();
|
||||||
}
|
}
|
||||||
|
public int Count(Expression<Func<T, bool>> whereExpression)
|
||||||
|
{
|
||||||
|
return Context.Queryable<T>().Where(whereExpression).Count();
|
||||||
|
}
|
||||||
public List<T> GetList(Expression<Func<T, bool>> whereExpression)
|
public List<T> GetList(Expression<Func<T, bool>> whereExpression)
|
||||||
{
|
{
|
||||||
return Context.Queryable<T>().Where(whereExpression).ToList();
|
return Context.Queryable<T>().Where(whereExpression).ToList();
|
||||||
|
Loading…
Reference in New Issue
Block a user