예제 #1
0
        public void Raise <T>(T @event)
        {
            var messageType = typeof(T);

            EnsureMessageIsRegistered(messageType);

            var logicalMessage = LogicalMessageFactory.Create(messageType, @event);

            if (PipelineFactory.CurrentContext is RootContext)
            {
                using (var childBuilder = Builder.CreateChildBuilder())
                {
                    PipelineFactory.CurrentContext.Set(childBuilder);
                    PipelineFactory.InvokeLogicalMessagePipeline(logicalMessage);
                }
            }
            else
            {
                PipelineFactory.InvokeLogicalMessagePipeline(logicalMessage);
            }
        }