Пример #1
0
        /// <summary>
        /// 注册消费者服务,获取消费创建对象
        /// </summary>
        /// <param name="services"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static IEasyNetQConsumerBuilder AddEasyNetQConsumer(this IServiceCollection services, Action <EasyNetQConsumerOptions> configure)
        {
            EasyNetQConsumerOptions easyNetQConsumerOptions = new EasyNetQConsumerOptions();

            configure?.Invoke(easyNetQConsumerOptions);
            return(services.AddEasyNetQConsumer(easyNetQConsumerOptions));
        }
Пример #2
0
 /// <summary>
 /// 注册消费者服务,获取消费创建对象
 /// </summary>
 /// <param name="services"></param>
 /// <param name="easyNetQConsumerOptions"></param>
 /// <returns></returns>
 public static IEasyNetQConsumerBuilder AddEasyNetQConsumer(this IServiceCollection services, EasyNetQConsumerOptions easyNetQConsumerOptions)
 {
     services.AddEasyNetQConsumerCore();
     return(new EasyNetQConsumerBuilder(services, easyNetQConsumerOptions));
 }