Esempio n. 1
0
        public static IConveyBuilder AddRabbitMq <TContext>(this IConveyBuilder builder,
                                                            Func <IRabbitMqOptionsBuilder, IRabbitMqOptionsBuilder> buildOptions,
                                                            Func <IRabbitMqPluginRegister, IRabbitMqPluginRegister> plugins     = null,
                                                            Func <IRedisOptionsBuilder, IRedisOptionsBuilder> buildRedisOptions = null)
            where TContext : class, new()
        {
            var options = buildOptions(new RabbitMqOptionsBuilder()).Build();

            return(buildRedisOptions is null
                ? builder.AddRabbitMq <TContext>(options, plugins)
                : builder.AddRabbitMq <TContext>(options, plugins, b => b.AddRedis(buildRedisOptions)));
        }
Esempio n. 2
0
        public static IConveyBuilder AddRabbitMq <TContext>(this IConveyBuilder builder, string sectionName = SectionName,
                                                            string redisSectionName = "redis", Func <IRabbitMqPluginRegister, IRabbitMqPluginRegister> plugins = null)
            where TContext : class, new()
        {
            var options      = builder.GetOptions <RabbitMqOptions>(sectionName);
            var redisOptions = builder.GetOptions <RedisOptions>(redisSectionName);

            return(builder.AddRabbitMq <TContext>(options, plugins, b => b.AddRedis(redisOptions)));
        }
        public static IConveyBuilder AddInfrastructure(this IConveyBuilder builder)
        {
            builder.Services.AddTransient <ITripsServiceClient, TripServiceClient>();

            builder
            //     .AddQueryHandlers()
            //     .AddInMemoryQueryDispatcher();
            .AddRabbitMq()
            .AddHttpClient();
            // .AddSwaggerDocs()
            // .AddWebApiSwaggerDocs();


            return(builder);
        }
Esempio n. 4
0
 public static IConveyBuilder AddRabbitMq <TContext>(this IConveyBuilder builder, RabbitMqOptions options,
                                                     Func <IRabbitMqPluginRegister, IRabbitMqPluginRegister> plugins = null,
                                                     RedisOptions redisOptions = null)
     where TContext : class, new()
 => builder.AddRabbitMq <TContext>(options, plugins, b => b.AddRedis(redisOptions ?? new RedisOptions()));