I have develpered 2 modules, say ModuleA, and ModuleB. In ModuleB, I have created an event handler for AbpTenantBase Created, and in somewhere of ModuleA, I add a new AbpTenant record. This event handler above in moduleB is executed but _unitOfWorkManager.Current is null which is not expected by me. How can I fix this? Thanks!
3 Answer(s)
-
0
Hi,
This is expected behaviour <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/EventBus-Domain-Events#entity-changes">http://aspnetboilerplate.com/Pages/Docu ... ty-changes</a>. Can you explain what you are trying to do ? Maybe we can help you in that way.
Thanks.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
For example, moduleB has data associated with user records, and in moduleA there is an operation to delete user, when the user is deleted, I want to delete the associated data in moduleB. So I create a event handler for user deleted in moduleB to do the operation. However, when the event is trigger, the UnitOfManager.Current is null (in usual case, it is not null).
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
You can add UnitOfWork attribute to your event handler method but in 'ed' events (ex: EntityUpdated) are triggered after saving changes and no chance to rollback the unit of work.
Can you try it that way ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)