From e656e15db68ccec0e6ae4809537719fce4aa6d6a Mon Sep 17 00:00:00 2001 From: skx <610262374@qq.com> Date: Sat, 16 Jan 2021 13:23:04 +0800 Subject: [PATCH] db.UseTran BUG --- Src/Asp.Net/SqlSugar/SqlSugarClient.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index d61cfcb60..b808240c3 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs @@ -940,6 +940,11 @@ namespace SqlSugar } private void AllClientEach(Action action) { + if (this._AllClients == null) + { + this._AllClients = new List(); + this._AllClients.Add(new SugarTenant() { ConnectionConfig=this.CurrentConnectionConfig, Context=this.Context }); + } if (_AllClients.HasValue()) { foreach (var item in _AllClients.Where(it => it.Context.HasValue()))