Update DistinctCount

This commit is contained in:
sunkaixuan
2022-10-10 14:10:32 +08:00
parent 62ec8491cf
commit 68cf9caa52

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();
}
}
}
}
}