diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index b2d361244..b0bd594ed 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -1598,6 +1598,8 @@ namespace SqlSugar { var contextProperty = item.GetType().GetProperty("Context"); SqlSugarContext newClient = this.Context.Utilities.CopyContext(); + if (newClient.CurrentConnectionConfig.AopEvents == null) + newClient.CurrentConnectionConfig.AopEvents = new AopEvents(); contextProperty.SetValue(item, newClient, null); } }