gpt4 book ai didi

asp.net-core - ABP : Value cannot be null.(参数 'unitOfWork')

转载 作者:行者123 更新时间:2023-12-02 16:00:33 28 4
gpt4 key购买 nike

我将我的 abp 版本从 3.5.0 升级到 7.0.0

我设置了方法的属性 UnitOfWork[IsDisabled = true]

然后我像这样运行代码:

xxRepository.GetAllList()

我得到异常:

Value cannot be null. (Parameter 'unitOfWork').

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

最佳答案

ABP v6.4 在 Minimize interception usage #6165 中删除了常规拦截器(针对 IRepositoryIApplicationService)引入了重大更改|可以选择 allow disabling the removal of conventional interceptors .

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

using (var uow = unitOfWorkManager.Begin())
{
xxs = xxRepository.GetAllList();
uow.Complete();
}

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

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

关于asp.net-core - ABP : Value cannot be null.(参数 'unitOfWork'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70768208/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com