From 27b31e254b7aa33a52673524ca27a651dcd41c13 Mon Sep 17 00:00:00 2001 From: jacob <45013176@qq.com> Date: Sat, 24 Mar 2018 19:36:34 +0800 Subject: [PATCH] Add Count() function to SimpleClient --- Src/Asp.Net/SqlSugar/SimpleClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/SimpleClient.cs b/Src/Asp.Net/SqlSugar/SimpleClient.cs index e0059f5ac..12feec343 100644 --- a/Src/Asp.Net/SqlSugar/SimpleClient.cs +++ b/Src/Asp.Net/SqlSugar/SimpleClient.cs @@ -135,6 +135,10 @@ namespace SqlSugar { return Context.Queryable().Where(whereExpression).Any(); } + public int Count(Expression> whereExpression){ + return Context.Queryable().Where(whereExpression).Count(); + } + public bool Insert(T insertObj) { return this.Context.Insertable(insertObj).ExecuteCommand() > 0;