public Task Send(PublishContext <T> context)
        {
            if (_context.ConversationId.HasValue)
            {
                context.ConversationId = _context.ConversationId;
            }

            if (_context.CorrelationId.HasValue)
            {
                context.InitiatorId = _context.CorrelationId;
            }

            return(_pipe.Send(context));
        }
Ejemplo n.º 2
0
        public override bool TryGetContext <TMessage>(out IBusPublishContext <TMessage> context)
        {
            context = null;

            if (typeof(TMessage).IsAssignableFrom(typeof(T)))
            {
                var busPublishContext = new PublishContext <TMessage>(Message as TMessage, this);
                busPublishContext._wasEndpointAlreadySent = _wasEndpointAlreadySent;
                busPublishContext.IfNoSubscribers(_noSubscribersAction);
                busPublishContext.ForEachSubscriber(_eachSubscriberAction);

                context = busPublishContext;
            }

            return(context != null);
        }
            bool IPipeContextConverter <PublishContext, PublishContext <T> > .TryConvert(PublishContext input, out PublishContext <T> output)
            {
                output = input as PublishContext <T>;

                return(output != null);
            }
Ejemplo n.º 4
0
 public PublishContextScope(PublishContext context)
     : base(context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 public PublishContextProxy(PublishContext context, TMessage message)
     : base(context)
 {
     Message = message;
 }