SimpleClient Add Count Method

This commit is contained in:
sunkaixuan 2019-04-10 19:34:16 +08:00
parent 9a462981dd
commit 8c08fa5cc1

View File

@ -24,6 +24,10 @@ namespace SqlSugar
{
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()
{
return Context.Queryable<T>().ToList();
@ -172,6 +176,10 @@ namespace SqlSugar
{
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)
{
return Context.Queryable<T>().Where(whereExpression).ToList();