From 21c27e35a5a484a9ea2f6cb7a5136011f33291d5 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 29 Jul 2024 10:03:08 +0800 Subject: [PATCH] Set event record extra properties from `eventInfo` Resolve #20298 --- .../DistributedEvents/IncomingEventRecord.cs | 4 ++++ .../DistributedEvents/OutgoingEventRecord.cs | 4 ++++ .../Volo/Abp/MongoDB/DistributedEvents/IncomingEventRecord.cs | 4 ++++ .../Volo/Abp/MongoDB/DistributedEvents/OutgoingEventRecord.cs | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/IncomingEventRecord.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/IncomingEventRecord.cs index 6d151851c48..6cb37a72d5e 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/IncomingEventRecord.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/IncomingEventRecord.cs @@ -44,6 +44,10 @@ public IncomingEventRecord( ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); + foreach (var property in eventInfo.ExtraProperties) + { + this.SetProperty(property.Key, property.Value); + } } public IncomingEventInfo ToIncomingEventInfo() diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/OutgoingEventRecord.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/OutgoingEventRecord.cs index 163e90e26df..7272c9ac30c 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/OutgoingEventRecord.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/OutgoingEventRecord.cs @@ -37,6 +37,10 @@ public OutgoingEventRecord( ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); + foreach (var property in eventInfo.ExtraProperties) + { + this.SetProperty(property.Key, property.Value); + } } public OutgoingEventInfo ToOutgoingEventInfo() diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/IncomingEventRecord.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/IncomingEventRecord.cs index 4b66c585954..a48492d1dab 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/IncomingEventRecord.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/IncomingEventRecord.cs @@ -44,6 +44,10 @@ public IncomingEventRecord( ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); + foreach (var property in eventInfo.ExtraProperties) + { + this.SetProperty(property.Key, property.Value); + } } public IncomingEventInfo ToIncomingEventInfo() diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/OutgoingEventRecord.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/OutgoingEventRecord.cs index a7f3d5ab149..24574d3600f 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/OutgoingEventRecord.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/OutgoingEventRecord.cs @@ -37,6 +37,10 @@ public OutgoingEventRecord( ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); + foreach (var property in eventInfo.ExtraProperties) + { + this.SetProperty(property.Key, property.Value); + } } public OutgoingEventInfo ToOutgoingEventInfo()