|
@@ -72,19 +72,9 @@ public static class DBServiceCollectionExtensions
|
|
|
var fsql = freeSqlBuilder.Build();
|
|
|
var user = services.BuildServiceProvider().GetService<IUser>();
|
|
|
|
|
|
- #region 全局过滤器
|
|
|
-
|
|
|
|
|
|
fsql.GlobalFilter.Apply<ISoftDelete>(FilterNames.SoftDelete, a => a.IsDeleted == false);
|
|
|
|
|
|
-
|
|
|
- if (appConfig.Tenant)
|
|
|
- {
|
|
|
- fsql.GlobalFilter.Apply<ITenant>(FilterNames.Tenant, a => a.TenantId == user.TenantId);
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
|
|
|
DbHelper.ConfigEntity(fsql, appConfig);
|
|
|
|
|
@@ -149,6 +139,12 @@ public static class DBServiceCollectionExtensions
|
|
|
|
|
|
#endregion 监听Curd操作
|
|
|
|
|
|
+
|
|
|
+ if (appConfig.Tenant)
|
|
|
+ {
|
|
|
+ fsql.GlobalFilter.Apply<ITenant>(FilterNames.Tenant, a => a.TenantId == user.TenantId);
|
|
|
+ }
|
|
|
+
|
|
|
return fsql;
|
|
|
});
|
|
|
|