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 1/2] 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; From cf99dbc7e7cc1e44d276454be95aeaecd1ee616a Mon Sep 17 00:00:00 2001 From: jacob <45013176@qq.com> Date: Sat, 24 Mar 2018 19:38:04 +0800 Subject: [PATCH 2/2] code format fix --- Src/Asp.Net/SqlSugar/SimpleClient.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/SimpleClient.cs b/Src/Asp.Net/SqlSugar/SimpleClient.cs index 12feec343..74f400855 100644 --- a/Src/Asp.Net/SqlSugar/SimpleClient.cs +++ b/Src/Asp.Net/SqlSugar/SimpleClient.cs @@ -136,7 +136,8 @@ namespace SqlSugar return Context.Queryable().Where(whereExpression).Any(); } public int Count(Expression> whereExpression){ - return Context.Queryable().Where(whereExpression).Count(); + + return Context.Queryable().Where(whereExpression).Count(); } public bool Insert(T insertObj)