From 02f57c0988ebac926478e81aa23b2c64cffe321a Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 17 Jun 2022 12:59:24 +0800 Subject: [PATCH] Update auto nolcok --- .../SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index 38ba3c9c8..a83fb2a18 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -2422,7 +2422,7 @@ namespace SqlSugar if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count==1) { var tableinfo = this.QueryBuilder.AsTables.First(); - if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockQuery == true) + if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockQuery == true&& this.QueryBuilder.AsTables.First().Value.ObjToString().Contains(SqlWith.NoLock) ==false) { this.QueryBuilder.AsTables[tableinfo.Key] = " (SELECT * FROM " + this.QueryBuilder.AsTables.First().Value + $" {SqlWith.NoLock} )"; }