public Task Publish <T>(T eventMessage, PublishOptions options) { if (!started) { throw new InvalidOperationException("The bus has not been started."); } var type = typeof(T); if (!busMessages.IsPublishable(type)) { throw BusMessages.CreateMessageNotFoundException(type); } return(options == null ? busTransport.Publish(eventMessage, MessageTypeToNamePublishingEventMap[type]) : busTransport.Publish(eventMessage, MessageTypeToNamePublishingEventMap[type], options)); }
public Task Publish <T>(T eventMessage, PublishOptions options = null) { var type = typeof(T); if (!busMessages.IsPublishable(type)) { throw BusMessages.CreateMessageNotFoundException(type); } return(busTransport.Publish(eventMessage, MessageTypeToNamePublishingEventMap[type], options)); }
public Task Publish <T>(T eventMessage) { if (!started) { throw new InvalidOperationException("The bus has not been started."); } var type = typeof(T); if (!busMessages.IsAnEvent(type)) { throw BusMessages.CreateMessageNotFoundException(type); } return(busTransport.Publish(eventMessage, busMessages.GetMessageTypeNameByType(type))); }