Add Count() function to SimpleClient<T>

This commit is contained in:
jacob
2018-03-24 19:36:34 +08:00
parent d2958e7ceb
commit 27b31e254b

View File

@@ -135,6 +135,10 @@ namespace SqlSugar
{
return Context.Queryable<T>().Where(whereExpression).Any();
}
public int Count(Expression<Func<T,bool>> whereExpression){
return Context.Queryable<T>().Where(whereExpression).Count();
}
public bool Insert(T insertObj)
{
return this.Context.Insertable(insertObj).ExecuteCommand() > 0;