Beispiel #1
0
        internal static void SetReceiveContextForSend <T>(ISendContext <T> context)
            where T : class
        {
            IConsumeContext currentConsumeContext = ContextStorage.CurrentConsumeContext;

            if (currentConsumeContext != null)
            {
                var receiveContext = currentConsumeContext as IReceiveContext;
                if (receiveContext != null)
                {
                    context.SetReceiveContext(receiveContext);
                }
                else if (currentConsumeContext.BaseContext != null)
                {
                    context.SetReceiveContext(currentConsumeContext.BaseContext);
                }
            }
        }