From c21683781d54398c7201caf5ee363c4ec5995fa2 Mon Sep 17 00:00:00 2001 From: skx <610262374@qq.com> Date: Sat, 6 Feb 2021 11:49:12 +0800 Subject: [PATCH] Code optimization --- .../Abstract/QueryableProvider/QueryableProvider.cs | 2 +- .../SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index b85478e6c..dcb78253e 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -409,7 +409,7 @@ namespace SqlSugar var whereIndex = QueryBuilder.WhereIndex; string parameterName = this.SqlBuilder.SqlParameterKeyWord + "InPara" + whereIndex; this.AddParameters(new SugarParameter(parameterName, inValues[0])); - this.Where(string.Format(QueryBuilder.InTemplate, filed, parameterName)); + this.Where(string.Format(QueryBuilder.EqualTemplate, filed, parameterName)); QueryBuilder.WhereIndex++; } else diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs index eb601cdad..d43ac3621 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs @@ -207,6 +207,13 @@ namespace SqlSugar return "{0} IN ({1}) "; } } + public virtual string EqualTemplate + { + get + { + return "{0} = {1} "; + } + } #endregion #region Common Methods