diff --git a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs index 37c744547f..cf3479de67 100644 --- a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs +++ b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs @@ -79,7 +79,13 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb { foreach (var localEvent in localEvents) { - UnitOfWorkManager.Current?.AddOrReplaceLocalEvent(new UnitOfWorkEventRecord(localEvent.GetType(), localEvent, EventOrderGenerator.GetNext())); + UnitOfWorkManager.Current?.AddOrReplaceLocalEvent( + new UnitOfWorkEventRecord( + localEvent.EventData.GetType(), + localEvent.EventData, + localEvent.EventOrder + ) + ); } generatesDomainEventsEntity.ClearLocalEvents(); @@ -90,7 +96,13 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb { foreach (var distributedEvent in distributedEvents) { - UnitOfWorkManager.Current?.AddOrReplaceDistributedEvent(new UnitOfWorkEventRecord(distributedEvent.GetType(), distributedEvent, EventOrderGenerator.GetNext())); + UnitOfWorkManager.Current?.AddOrReplaceDistributedEvent( + new UnitOfWorkEventRecord( + distributedEvent.EventData.GetType(), + distributedEvent.EventData, + distributedEvent.EventOrder + ) + ); } generatesDomainEventsEntity.ClearDistributedEvents(); diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index eb960ea5d0..a40117e0ff 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -653,7 +653,13 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { foreach (var localEvent in localEvents) { - UnitOfWorkManager.Current?.AddOrReplaceLocalEvent(new UnitOfWorkEventRecord(localEvent.GetType(), localEvent, EventOrderGenerator.GetNext())); + UnitOfWorkManager.Current?.AddOrReplaceLocalEvent( + new UnitOfWorkEventRecord( + localEvent.EventData.GetType(), + localEvent.EventData, + localEvent.EventOrder + ) + ); } generatesDomainEventsEntity.ClearLocalEvents(); @@ -664,7 +670,13 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { foreach (var distributedEvent in distributedEvents) { - UnitOfWorkManager.Current?.AddOrReplaceDistributedEvent(new UnitOfWorkEventRecord(distributedEvent.GetType(), distributedEvent, EventOrderGenerator.GetNext())); + UnitOfWorkManager.Current?.AddOrReplaceDistributedEvent( + new UnitOfWorkEventRecord( + distributedEvent.EventData.GetType(), + distributedEvent.EventData, + distributedEvent.EventOrder + ) + ); } generatesDomainEventsEntity.ClearDistributedEvents();