CreateEventGeneric() public method

public CreateEventGeneric ( Type, openGeneric, Type, closingType ) : TEvent,
openGeneric Type,
closingType Type,
return TEvent,
コード例 #1
0
    /// <inheritdoc />
    public async Task Send(string destinationAddress, object explicitlyRoutedMessage, IDictionary <string, string> optionalHeaders = null)
    {
        var messageSentToDestination = _factory.CreateEventGeneric <MessageSentToDestination>(
            typeof(MessageSentToDestination <>),
            explicitlyRoutedMessage.GetType(),
            destinationAddress,
            explicitlyRoutedMessage,
            optionalHeaders,
            _rebusTime.Now
            );

        _recorder.Record(messageSentToDestination);
    }
コード例 #2
0
    /// <inheritdoc />
    public async Task Publish(string topic, object eventMessage, IDictionary <string, string> optionalHeaders = null)
    {
        var messagePublishedToTopicEvent = _factory.CreateEventGeneric <MessagePublishedToTopic>(
            typeof(MessagePublishedToTopic <>),
            eventMessage.GetType(),
            topic,
            eventMessage,
            optionalHeaders,
            _rebusTime.Now
            );

        _recorder.Record(messagePublishedToTopicEvent);
    }
コード例 #3
0
        /// <inheritdoc />
        public void SendLocal(object commandMessage, IDictionary <string, string> optionalHeaders = null)
        {
            var messageSentToSelfEvent = _factory.CreateEventGeneric <MessageSentToSelf>(typeof(MessageSentToSelf <>), commandMessage.GetType(), commandMessage, optionalHeaders, _rebusTime.Now);

            Record(messageSentToSelfEvent);
        }