ABP:值不能为空。(参数“工作单元”)

Mar*_*ark 3 asp.net-core aspnetboilerplate

我将 abp 版本从 升级3.5.07.0.0.

\n

我设置了 method\xe2\x80\x99s attribute UnitOfWork[IsDisabled = true]

\n

然后我运行如下代码:

\n
xxRepository.GetAllList()\n
Run Code Online (Sandbox Code Playgroud)\n

我得到例外:

\n
Value cannot be null. (Parameter 'unitOfWork').\n
Run Code Online (Sandbox Code Playgroud)\n

为什么?为什么不再支持禁用工作单元中的 getalllist 呢?在这种情况下,如何循环更新 1,000,000 条数据?

\n

aar*_*ron 8

ABP v6.4 在最小化拦截使用#6165中引入了一项重大更改,删除了传统拦截器(forIRepositoryIApplicationService) ,并提供了允许禁用删除传统拦截器的选项。

您应该明确地开始一个工作单元:

using (var uow = unitOfWorkManager.Begin())
{
    xxs = xxRepository.GetAllList();
    uow.Complete();
}
Run Code Online (Sandbox Code Playgroud)

您可以恢复以前的行为,但此选项可能会在更高版本中删除:

return services.AddAbp<AbpProjectNameWebTestModule>(options =>
{
    options.SetupTest();
// });                                     // Change this
}, removeConventionalInterceptors: false); // to this
Run Code Online (Sandbox Code Playgroud)