From d6d7f1bab9a4be1198f0819afa5e9afcfdbbc0d8 Mon Sep 17 00:00:00 2001 From: skx <610262374@qq.com> Date: Sat, 19 Dec 2020 14:51:51 +0800 Subject: [PATCH] Change database aop bug --- Src/Asp.Net/SqlSugar/SqlSugarClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index 63287a7c6..8dee028ee 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs @@ -553,6 +553,8 @@ namespace SqlSugar if (this._IsOpen) this.Open(); _Context.Ado.IsEnableLogEvent = isLog; + if (_CurrentConnectionConfig.AopEvents==null) + _CurrentConnectionConfig.AopEvents = new AopEvents(); } public void ChangeDatabase(Func changeExpression) { @@ -565,6 +567,8 @@ namespace SqlSugar if (this._IsOpen) this.Open(); _Context.Ado.IsEnableLogEvent = isLog; + if (_CurrentConnectionConfig.AopEvents == null) + _CurrentConnectionConfig.AopEvents = new AopEvents(); } public void BeginTran() {