Browse Source

Serialize properties in derived classes (#1732)

System.Text.Json serializes based on static type of value parameter. Polymorphic serialization requires type information
pull/1759/head
Michael Gregson 3 years ago
committed by GitHub
parent
commit
8807359057
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs

+ 1
- 1
src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs View File

@ -35,7 +35,7 @@
public void Publish(IntegrationEvent @event)
{
var eventName = @event.GetType().Name.Replace(INTEGRATION_EVENT_SUFFIX, "");
var jsonMessage = JsonSerializer.Serialize(@event);
var jsonMessage = JsonSerializer.Serialize(@event, @event.GetType());
var body = Encoding.UTF8.GetBytes(jsonMessage);
var message = new Message


Loading…
Cancel
Save