Browse Source

Update auto nolcok

pull/19/head
sunkaixuan 2 years ago
parent
commit
02f57c0988
  1. 2
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

2
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -2422,7 +2422,7 @@ namespace SqlSugar
if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count==1) if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count==1)
{ {
var tableinfo = this.QueryBuilder.AsTables.First(); 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} )"; this.QueryBuilder.AsTables[tableinfo.Key] = " (SELECT * FROM " + this.QueryBuilder.AsTables.First().Value + $" {SqlWith.NoLock} )";
} }

Loading…
Cancel
Save