Browse Source

Fix mongo and memory db implementations for event publishing.

pull/9909/head
Halil İbrahim Kalkan 5 years ago
parent
commit
92f09650ea
  1. 16
      framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs
  2. 16
      framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs

16
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) 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(); generatesDomainEventsEntity.ClearLocalEvents();
@ -90,7 +96,13 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb
{ {
foreach (var distributedEvent in distributedEvents) 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(); generatesDomainEventsEntity.ClearDistributedEvents();

16
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) 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(); generatesDomainEventsEntity.ClearLocalEvents();
@ -664,7 +670,13 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
{ {
foreach (var distributedEvent in distributedEvents) 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(); generatesDomainEventsEntity.ClearDistributedEvents();

Loading…
Cancel
Save