Exemple #1
0
        /// <summary>
        /// 添加事件消息总线
        /// </summary>
        /// <param name="services"></param>
        /// <param name="configuration"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static IEventBusBuilder AddEventBus(this IServiceCollection services, IConfiguration configuration, Action <IEventBusBuilder> action)
        {
            var builder = new EventBusBuilder(services, configuration);

            action(builder);
            return(builder);
        }
Exemple #2
0
        /// <summary>
        /// 添加事件消息总线
        /// </summary>
        /// <param name="services"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static IEventBusBuilder AddEventBus(this IServiceCollection services, Action <IEventBusBuilder> action)
        {
            var service       = services.First(x => x.ServiceType == typeof(IConfiguration));
            var configuration = (IConfiguration)service.ImplementationFactory.Invoke(null);
            var builder       = new EventBusBuilder(services, configuration);

            action(builder);
            return(builder);
        }