Activities of "gizem.kip"

Question

Hello, I'm currently working with local events in my project but I have faced 2 issues.

First one, even I set the onUnitOfWorkComplete parameter as false still the task is waiting for to complete unit of work task. My only solution is removing "await" on publichAsync. Detail is as below.

Working:

                LocalEventBus.PublishAsync(
                    new ImportXmlEvent
                    {
                        IncomingFileId = input.IncomingModelFileId,
                        SourceName = input.SourceName,
                        ModelId = id,
                        CorrelationId = HttpContextAccessor.HttpContext?.TraceIdentifier
                    },false);

Doesn't Work:

 await LocalEventBus.PublishAsync(
                    new ImportXmlEvent
                    {
                        IncomingFileId = input.IncomingModelFileId,
                        SourceName = input.SourceName,
                        ModelId = id,
                        CorrelationId = HttpContextAccessor.HttpContext?.TraceIdentifier
                    },false);`

Second issue, after event published, even event handler method is virtual still it is not working correctly without using _unitOfWorkManager as below. Without using _unitOfWorkManager, child entities is not commiting to the db.

Working:

  [UnitOfWork]
        public virtual async Task HandleEventAsync(ImportXmlEvent eventData)
        {
            using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) 
            {
                ...
             }
            }
  • Database System: EF Core (SQL Server)
Showing 1 to 1 of 1 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 10, 2025, 12:38