|
@ -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} )"; |
|
|
} |
|
|
} |
|
|