- 移除 IBaseRepository DataFilter 仓储过滤器;

This commit is contained in:
2881099
2024-07-24 03:27:31 +08:00
parent e461e60113
commit 3e3fcf9580
8 changed files with 2 additions and 472 deletions

View File

@ -13,18 +13,10 @@ namespace Microsoft.Extensions.DependencyInjection
/// 批量注入 Repository可以参考代码自行调整
/// </summary>
/// <param name="services"></param>
/// <param name="globalDataFilter"></param>
/// <param name="assemblies"></param>
/// <returns></returns>
public static IServiceCollection AddFreeRepository(this IServiceCollection services, Action<FluentDataFilter> globalDataFilter = null, params Assembly[] assemblies)
public static IServiceCollection AddFreeRepository(this IServiceCollection services, params Assembly[] assemblies)
{
if (globalDataFilter != null)
{
DataFilterUtil._globalDataFilter = globalDataFilter;
//如果看到了这里的代码,想自己调整,但因为 _globalDataFilter 是内部属性,无法修改?
//请考虑改用 fsql.GlobalFilter.Apply
}
services.AddScoped(typeof(IBaseRepository<>), typeof(GuidRepository<>));
services.AddScoped(typeof(BaseRepository<>), typeof(GuidRepository<>));