mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-25 04:27:14 +08:00
Optimization tips
This commit is contained in:
@@ -637,7 +637,8 @@ namespace SqlSugar
|
||||
public SqlSugarProvider GetConnectionWithAttr<T>()
|
||||
{
|
||||
var attr = typeof(T).GetCustomAttribute<TenantAttribute>();
|
||||
Check.ExceptionEasy(attr==null,"not TenantAttribute", "不存在特性 TenantAttribute");
|
||||
if (attr == null)
|
||||
return this.GetConnection(this.CurrentConnectionConfig.ConfigId);
|
||||
var configId = attr.configId;
|
||||
return this.GetConnection(configId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user