mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
Update core
This commit is contained in:
@@ -72,5 +72,17 @@ namespace SqlSugar
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void SetShortNameNext(MethodCallExpression exp, string result)
|
||||||
|
{
|
||||||
|
if (exp.Arguments.Count>1&&exp.Arguments[1] is LambdaExpression && result.IsContainsIn("+", "-"))
|
||||||
|
{
|
||||||
|
var parameters = (exp.Arguments[1] as LambdaExpression).Parameters;
|
||||||
|
if (parameters != null && parameters.Count > 0)
|
||||||
|
{
|
||||||
|
this.Context.CurrentShortName = this.Context.SqlTranslationLeft + parameters[0] + this.Context.SqlTranslationRight;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace SqlSugar
|
namespace SqlSugar
|
||||||
{
|
{
|
||||||
@@ -48,6 +49,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
Check.Exception(true, ErrorMessage.WhereIFCheck,exp.Arguments[0].ToString());
|
Check.Exception(true, ErrorMessage.WhereIFCheck,exp.Arguments[0].ToString());
|
||||||
}
|
}
|
||||||
|
if (Regex.Matches(expression.ToString(), "Subqueryable").Count >= 2)
|
||||||
|
{
|
||||||
|
new SubSelect() { Context = this.Context }.SetShortNameNext(exp, "+");
|
||||||
|
}
|
||||||
var isWhere= Convert.ToBoolean(value);
|
var isWhere= Convert.ToBoolean(value);
|
||||||
if (!Convert.ToBoolean(isWhere)) {
|
if (!Convert.ToBoolean(isWhere)) {
|
||||||
return "WHERE 1=1 ";
|
return "WHERE 1=1 ";
|
||||||
|
Reference in New Issue
Block a user