/// <summary> /// Subcribes the asynchronous. /// </summary> /// <typeparam name="T"></typeparam> /// <typeparam name="TH">The type of the h.</typeparam> /// <param name="message">The message.</param> /// <param name="handler">The handler.</param> public void SubcribeAsync <T>(IEventBusHandlerBase <T> handler) where T : EventBase { Task OnMessage(T request) => Task.Run(() => { handler.Handle(request); }); this.adapter.Bus.SubscribeAsync <T>(string.Empty, OnMessage); }
/// <summary> /// Subcribes the specified message. /// </summary> /// <typeparam name="T"></typeparam> /// <typeparam name="TH">The type of the h.</typeparam> /// <param name="message">The message.</param> /// <param name="handler">The handler.</param> public void Subcribe <T>(IEventBusHandlerBase <T> handler) where T : EventBase { this.adapter.Bus.Subscribe <T>(string.Empty, handler.Handle); }