Update exp to sql

This commit is contained in:
sunkaixuan
2023-07-26 17:15:51 +08:00
parent 729e7ac62d
commit cc678a0834
3 changed files with 9 additions and 1 deletions

View File

@@ -55,6 +55,10 @@ namespace SqlSugar
this.Context.GetTranslationColumnName(parameter.Name),
tableName,
null);
if (this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.DbType==DbType.SqlServer&&this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockSubquery==true)
{
joinString = $"{joinString} {SqlWith.NoLock} ";
}
var result = joinString+ "ON " + SubTools.GetMethodValue(Context, argExp, ResolveExpressType.WhereMultiple);
//var selfParameterName = Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
this.Context.JoinIndex++;

View File

@@ -55,6 +55,10 @@ namespace SqlSugar
this.Context.GetTranslationColumnName(parameter.Name),
tableName,
null);
if (this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.DbType == DbType.SqlServer && this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockSubquery == true)
{
joinString = $"{joinString} {SqlWith.NoLock} ";
}
var result = joinString+ "ON " + SubTools.GetMethodValue(Context, argExp, ResolveExpressType.WhereMultiple);
//var selfParameterName = Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
this.Context.JoinIndex++;

View File

@@ -244,7 +244,7 @@ namespace SqlSugar
isubList.Add(new SubSelectDefault());
}
var db = this.context?.SugarContext?.Context;
if (db != null)
if (db != null&& db?.CurrentConnectionConfig?.DbType == DbType.SqlServer)
{
if (db.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockSubquery == true)
{