question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why UnitOfWorkManager.Current in Domin Event Handlers is null?

See original GitHub issue

Hi, I get UnitOfWorkManager.Current in my domain event handler and always it is null !! I need doing some transactional action in my event handler. I set also UnitOfWork attribute on my handler. what is the solution for my problem?

  [UnitOfWork]
  public void HandleEvent(EntityCreatedEventData<CustomerProfileChangeRequest> eventData)
  {
    // UnitOfWorkManager.Current is null here
  }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ismcagdascommented, Jul 16, 2019

@mehdihadeli make HandleEvent virtual.

0reactions
ddo88commented, Feb 25, 2023

@mehdihadeli make HandleEvent virtual.

thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

unitOfManager.Current alwasy null in EventHandler #2626
In ModuleB, I have created an event handler for AbpTenantBase Created, and in somewhere of ModuleA, I add a new AbpTenant record. This...
Read more >
Unit Of Work | Documentation Center | ABP.IO
Current Unit Of Work can be null if there is no surrounding unit of work. It won't be null if your class is...
Read more >
.net core - Object reference null problem while using ...
1 Answer. You need to Begin a unit of work before SetTenantID on the (current) unit of work.
Read more >
EventHandler is Null When running MVVM
When the SelectedUniverse is changed, it sends that variable to the ViewModelController , which should invoke the UniverseChanged event. However ...
Read more >
Conventional Unit Of Work Methods
Note that if the current unit of work is transactional, all changes in the transaction are rolled back if an exception occurs. Even...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found