From 4d964a7c8ef40b4ac2982db0cd4eeebacb762ce4 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 28 Aug 2017 01:38:33 +0800 Subject: [PATCH] Code optimization --- .../SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs | 2 +- .../Realization/SqlServer/SqlBuilder/SqlServerQueryBuilder.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs index 0b61128fe..bf291dedc 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs @@ -238,7 +238,7 @@ namespace SqlSugar string orderByValue = (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : null; if (this.IsCount) { orderByValue = null; } sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, groupByValue, orderByValue); - sql.Replace("{$:OrderByString:$}", isRowNumber ? (this.IsCount ? null : rowNumberString) : null); + sql.Replace(UtilConstants.OrderReplace, isRowNumber ? (this.IsCount ? null : rowNumberString) : null); if (this.IsCount) { return sql.ToString(); } var result = ToPageSql(sql.ToString(), this.Take, this.Skip); if (ExternalPageIndex > 0) diff --git a/Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerQueryBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerQueryBuilder.cs index 800b202b5..d226d9ca3 100644 --- a/Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerQueryBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerQueryBuilder.cs @@ -12,7 +12,7 @@ namespace SqlSugar { get { - return "SELECT {0}{{$:OrderByString:$}} FROM {1}{2}{3}{4}"; + return "SELECT {0}{"+UtilConstants.OrderReplace+"} FROM {1}{2}{3}{4}"; } } }