Synchronization code

This commit is contained in:
sunkaixuan
2022-10-10 14:25:36 +08:00
parent 68cf9caa52
commit aff01883da
2 changed files with 14 additions and 1 deletions

View File

@@ -44,6 +44,7 @@ namespace SqlSugar
{
var exp = expression as MethodCallExpression;
var argExp = exp.Arguments[0];
InitType(exp);
var parametres = (argExp as LambdaExpression).Parameters;
if ((argExp as LambdaExpression).Body is UnaryExpression)
{
@@ -64,5 +65,17 @@ namespace SqlSugar
result = result.Replace(selfParameterName, SubTools.GetSubReplace(this.Context));
return result;
}
private void InitType(MethodCallExpression exp)
{
foreach (var arg in (exp.Arguments[0] as LambdaExpression).Parameters)
{
if (this.Context.InitMappingInfo != null)
{
this.Context.InitMappingInfo(arg.Type);
this.Context.RefreshMapping();
}
}
}
}
}

View File

@@ -2,7 +2,7 @@
<package >
<metadata>
<id>SqlSugarCore</id>
<version>5.1.3.24</version>
<version>5.1.3.25-preview03</version>
<authors>sunkaixuan</authors>
<owners>果糖大数据科技</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>