Beispiel #1
0
        public static IBioWorldBuilder AddFabio(this IBioWorldBuilder builder,
                                                Func <IFabioOptionsBuilder, IFabioOptionsBuilder> buildOptions,
                                                Func <IConsulOptionsBuilder, IConsulOptionsBuilder> buildConsulOptions,
                                                HttpClientOptions httpClientOptions)
        {
            var fabioOptions = buildOptions(new FabioOptionsBuilder()).Build();

            return(builder.AddFabio(fabioOptions, httpClientOptions,
                                    b => b.AddConsul(buildConsulOptions, httpClientOptions)));
        }
Beispiel #2
0
        public static IBioWorldBuilder AddFabio(this IBioWorldBuilder builder, string sectionName = SectionName,
                                                string consulSectionName = "consul", string httpClientSectionName = "httpClient")
        {
            if (string.IsNullOrWhiteSpace(sectionName))
            {
                sectionName = SectionName;
            }

            var fabioOptions      = builder.GetOptions <FabioOptions>(sectionName);
            var consulOptions     = builder.GetOptions <ConsulOptions>(consulSectionName);
            var httpClientOptions = builder.GetOptions <HttpClientOptions>(httpClientSectionName);

            return(builder.AddFabio(fabioOptions, httpClientOptions,
                                    b => b.AddConsul(consulOptions, httpClientOptions)));
        }
Beispiel #3
0
 public static IBioWorldBuilder AddFabio(this IBioWorldBuilder builder, FabioOptions fabioOptions,
                                         ConsulOptions consulOptions, HttpClientOptions httpClientOptions)
 => builder.AddFabio(fabioOptions, httpClientOptions, b => b.AddConsul(consulOptions, httpClientOptions));