public void Publish <TEvent>(TEvent @event) where TEvent : Event { RabbitFixtureBuilder.New("localhost", false) .WithOpenConection() .WithChannel() .QueueDeclare <TEvent>() .BasicPublish(@event); }
public void Subscribe <TEvent, TEventHandler>() where TEvent : Event where TEventHandler : IEventHandler <TEvent> { _HandlerTypes.Add <TEvent, TEventHandler>(); RabbitFixtureBuilder.New("localhost", true) .WithOpenConection() .WithChannel() .QueueDeclare <TEvent>() .BasicConsume <TEvent>(Consumer_Received); }