Skip to content

No messages received with wrapped method #14

@fryette

Description

@fryette

Hi, I found an issue that if you have for example this wrapper:

private static readonly IEventBus EventBus;

public static void Publish(EventBase message)
{
      EventBus.Publish(message);
}

// in another class

EventBusWrapper.Publish(new Payload(payload))

EventBus cannot find any event except EventBase.

But if you declare the method as below, everything works as should:

public static void Publish<T>(T message) where T : EventBase
{
      EventBus.Publish(message);
}

I spent a few hours to find a root cause. Maybe it saves time for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions