/// <summary> /// The resolve consumer. /// </summary> /// <param name="element"> /// The name. /// </param> /// <param name="messageType"> /// The message type. /// </param> /// <param name="endpointName"></param> /// <returns> /// The <see cref="object"/>. /// </returns> private object ResolveConsumer(IncomingElement element, Type messageType, string endpointName) { var consumer = this.dependencyResolver.Resolve(element.React, typeof(IConsumerOf <>).MakeGenericType(messageType)); foreach (var configurator in this.childConfigurators) { consumer = configurator.DecorateConsumer(consumer, messageType, element, endpointName); } return(consumer); }
/// <summary> /// The build consumer factory. /// </summary> /// <param name="element"> /// The name. /// </param> /// <param name="messageType"> /// The message type. /// </param> /// <param name="endpointName"></param> /// <returns> /// The <see cref="Func{TResult}"/>. /// </returns> private Func <object> BuildConsumerFactory(IncomingElement element, Type messageType, string endpointName) { return(() => this.ResolveConsumer(element, messageType, endpointName)); }