public void ApplyTransactionSupport(IChain chain) { var shouldFlushOutgoingMessages = false; if (chain is RouteChain) { shouldFlushOutgoingMessages = chain.As <RouteChain>().Action.Method.GetParameters() .Any(x => x.ParameterType == typeof(IMessageContext)); } var frame = new SqlTransactionFrame { ShouldFlushOutgoingMessages = shouldFlushOutgoingMessages }; chain.Middleware.Add(frame); }