From f992f3ba59f2b5f738772e82982284f0131bafab Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 15 Apr 2019 12:41:45 +0800 Subject: [PATCH] Add Ado.GetLong --- Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs | 4 ++++ Src/Asp.Net/SqlSugar/Interface/IAdo.cs | 1 + 2 files changed, 5 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs index 4d4600dc5..27adf36ae 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs @@ -463,6 +463,10 @@ namespace SqlSugar { return GetInt(sql, this.GetParameters(parameters)); } + public virtual long GetLong(string sql, object parameters) + { + return Convert.ToInt64(GetScalar(sql, GetParameters(parameters))); + } public virtual int GetInt(string sql, params SugarParameter[] parameters) { return GetScalar(sql, parameters).ObjToInt(); diff --git a/Src/Asp.Net/SqlSugar/Interface/IAdo.cs b/Src/Asp.Net/SqlSugar/Interface/IAdo.cs index 43d793ed1..b84012ea1 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IAdo.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IAdo.cs @@ -57,6 +57,7 @@ namespace SqlSugar int GetInt(string sql, object pars); int GetInt(string sql, params SugarParameter[] parameters); int GetInt(string sql, List parameters); + int GetLong(string sql, object pars); Double GetDouble(string sql, object parameters); Double GetDouble(string sql, params SugarParameter[] parameters); Double GetDouble(string sql, List parameters);