From 2213a49b00ea83fa4394c9b7408b7b5365790d31 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 9 Apr 2022 16:26:24 +0800 Subject: [PATCH] Optimization tips --- Src/Asp.Net/SqlSugar/SqlSugarClient.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index 177ac9be4..74761e7db 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs @@ -637,7 +637,8 @@ namespace SqlSugar public SqlSugarProvider GetConnectionWithAttr() { var attr = typeof(T).GetCustomAttribute(); - Check.ExceptionEasy(attr==null,"not TenantAttribute", "不存在特性 TenantAttribute"); + if (attr == null) + return this.GetConnection(this.CurrentConnectionConfig.ConfigId); var configId = attr.configId; return this.GetConnection(configId); }