public static IBioWorldBuilder AddRabbitMq <TContext>(this IBioWorldBuilder 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))); }
public static IBioWorldBuilder AddRabbitMq <TContext>(this IBioWorldBuilder builder, string sectionName = SectionName, string redisSectionName = "redis", Func <IRabbitMqPluginRegister, IRabbitMqPluginRegister> plugins = null) where TContext : class, new() { if (string.IsNullOrWhiteSpace(sectionName)) { sectionName = SectionName; } var options = builder.GetOptions <RabbitMqOptions>(sectionName); var redisOptions = builder.GetOptions <RedisOptions>(redisSectionName); return(builder.AddRabbitMq <TContext>(options, plugins, b => b.AddRedis(redisOptions))); }
public static IBioWorldBuilder AddRabbitMq <TContext>(this IBioWorldBuilder 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()));