Synchronization code

This commit is contained in:
sunkaixuan 2024-04-10 15:18:26 +08:00
parent b52ad1d046
commit 458823d1dd
3 changed files with 10 additions and 1 deletions

View File

@ -1820,7 +1820,14 @@ namespace SqlSugar
var moreSetts = this.Context.CurrentConnectionConfig.MoreSettings;
if (moreSetts != null && moreSetts.IsWithNoLockQuery && string.IsNullOrEmpty(QueryBuilder.TableWithString))
{
this.With(SqlWith.NoLock);
if (moreSetts.DisableWithNoLockWithTran&&this.Context.Ado.IsAnyTran())
{
//No With(nolock)
}
else
{
this.With(SqlWith.NoLock);
}
}
}
protected List<TResult> GetData<TResult>(KeyValuePair<string, List<SugarParameter>> sqlObj)

View File

@ -9,6 +9,7 @@ namespace SqlSugar
{
public bool IsAutoRemoveDataCache { get; set; }
public bool IsWithNoLockQuery { get; set; }
public bool DisableWithNoLockWithTran { get; set; }
public bool IsWithNoLockSubquery { get; set; }
public bool DisableNvarchar { get; set; }

View File

@ -641,6 +641,7 @@ namespace SqlSugar
PgSqlIsAutoToLowerCodeFirst= it.MoreSettings.PgSqlIsAutoToLowerCodeFirst,
IsAutoRemoveDataCache = it.MoreSettings.IsAutoRemoveDataCache,
IsWithNoLockQuery = it.MoreSettings.IsWithNoLockQuery,
DisableWithNoLockWithTran=it.MoreSettings.DisableWithNoLockWithTran,
TableEnumIsString = it.MoreSettings.TableEnumIsString,
DisableMillisecond = it.MoreSettings.DisableMillisecond,
DbMinDate=it.MoreSettings.DbMinDate,