/// <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)); }
/// <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)); }