diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs index 5452fed77..7ecc9e13c 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs @@ -438,6 +438,8 @@ namespace SqlSugar result.QueryBuilder.IsSqlQuery = false; result.QueryBuilder.NoCheckInclude = true; result.QueryBuilder.WhereIndex = (QueryBuilder.WhereIndex + 1); + var appendIndex = result.QueryBuilder.Parameters == null ? 1 : result.QueryBuilder.Parameters.Count + 1; + result.QueryBuilder.LambdaExpressions.ParameterIndex = (QueryBuilder.LambdaExpressions.ParameterIndex + appendIndex); result.QueryBuilder.Includes = queryable.QueryBuilder.Includes?.ToList(); return result; }