Ejemplo n.º 1
0
        /// <summary>
        /// Adds a handler to the receive endpoint with additional configuration specified
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="configurator"></param>
        /// <param name="handler"></param>
        /// <param name="configure"></param>
        public static void Handler <T>(this IReceiveEndpointConfigurator configurator, MessageHandler <T> handler,
                                       Action <IHandlerConfigurator <T> > configure = null)
            where T : class
        {
            var handlerConfigurator = new HandlerConfigurator <T>(handler);

            configure?.Invoke(handlerConfigurator);

            configurator.AddEndpointSpecification(handlerConfigurator);
        }
Ejemplo n.º 2
0
        protected void For <TParent>(Func <TState, Ref <TParent>, bool> condition, Action <HandlerConfigurator <TParent> > config) where TParent : IHasID <ID>
        {
            var c = new HandlerConfigurator <TParent>(this, condition);

            config(c);
        }