Beispiel #1
0
        public static IBioWorldBuilder AddConsul(this IBioWorldBuilder builder,
                                                 Func <IConsulOptionsBuilder, IConsulOptionsBuilder> buildOptions, HttpClientOptions httpClientOptions)
        {
            var options = buildOptions(new ConsulOptionsBuilder()).Build();

            return(builder.AddConsul(options, httpClientOptions));
        }
Beispiel #2
0
        public static IBioWorldBuilder AddConsul(this IBioWorldBuilder builder, string sectionName = SectionName,
                                                 string httpClientSectionName = "httpClient")
        {
            if (string.IsNullOrWhiteSpace(sectionName))
            {
                sectionName = SectionName;
            }

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

            return(builder.AddConsul(consulOptions, httpClientOptions));
        }