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);