|
|
@@ -6,6 +6,9 @@ namespace Admin.NET.Core;
|
|
|
|
|
|
public static class SqlSugarSetup
|
|
|
{
|
|
|
+ // 多租户实例
|
|
|
+ public static ITenant ITenant { get; set; }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// SqlSugar 上下文初始化
|
|
|
/// </summary>
|
|
|
@@ -39,6 +42,7 @@ public static class SqlSugarSetup
|
|
|
SetDbDiffLog(dbProvider, config);
|
|
|
});
|
|
|
});
|
|
|
+ ITenant = sqlSugar;
|
|
|
|
|
|
services.AddSingleton<ISqlSugarClient>(sqlSugar); // 单例注册
|
|
|
services.AddScoped(typeof(SqlSugarRepository<>)); // 仓储注册
|