Hi,
I have a problem while handling CRUD event of an entity whenever I try to read objects on the different DbContext it gives me this error:
After look up the code in Uow I found this :
Should _databaseApis.Values be _databaseApis.Values.ToImmutableList().
Many thanks for your help .
ToImmutableList doesn't seem to solve the underlying problem. Can you share some code to reproduce this problem?
Sure. I have custom the AbpAuditPropertySetter to use int instead of GUID so i override the SetCreationAuditProperties to use my CustomAuditPropertySetter.
The CurrentUser.Id is get by query the database by another DbContext
@hieutns96 Can you share the complete project code? You can create a project using cli. : )
@maliming i affraid i cannot share the complete project but I found this issue on the old project ASP Boiplerplate that have same issue with me. https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1860
I belive the _databaseApis.Values has been change during the transaction of SaveChangeAsync :)
Thank you very much, we will confirm this.
@maliming Thank you very much, I really appreciate your help. If it is possible when you find the issue, please share with me work around for this to work :)
I have the same issue, looking ahead to meet the fix it right now.
I already open the PR.
https://github.com/abpframework/abp/pull/1422
when do you deployment new version 0.19.0? it's an urgent issue with my project.
hi @hieutns96
You can temporarily create the MyUnitOfWork class with the latest code and then replace the built-in UnitOfWork.
@maliming How to replace the built-in UnitOfWork. I'm using the volo.abp.core from Nuget, and have the abp source code from the GitHub.
Use dependency injection to replace built-in components.
ReplaceServices: Set true to replace services if they are already registered before. Uses Replace extension method of IServiceCollection.
https://docs.abp.io/en/abp/latest/Dependency-Injection#dependency-attribute