Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 8807359

Browse files
Serialize properties in derived classes (#1732)
System.Text.Json serializes based on static type of value parameter. Polymorphic serialization requires type information
1 parent e57a97d commit 8807359

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public EventBusServiceBus(IServiceBusPersisterConnection serviceBusPersisterConn
3535
public void Publish(IntegrationEvent @event)
3636
{
3737
var eventName = @event.GetType().Name.Replace(INTEGRATION_EVENT_SUFFIX, "");
38-
var jsonMessage = JsonSerializer.Serialize(@event);
38+
var jsonMessage = JsonSerializer.Serialize(@event, @event.GetType());
3939
var body = Encoding.UTF8.GetBytes(jsonMessage);
4040

4141
var message = new Message

0 commit comments

Comments
 (0)