Пример #1
0
        public static IConveyBuilder AddConsul(this IConveyBuilder builder,
                                               Func <IConsulOptionsBuilder, IConsulOptionsBuilder> buildOptions, HttpClientOptions httpClientOptions)
        {
            var options = buildOptions(new ConsulOptionsBuilder()).Build();

            return(builder.AddConsul(options, httpClientOptions));
        }
Пример #2
0
        public static IConveyBuilder AddConsul(this IConveyBuilder builder, string sectionName = SectionName,
                                               string httpClientSectionName = "httpClient")
        {
            var consulOptions     = builder.GetOptions <ConsulOptions>(sectionName);
            var httpClientOptions = builder.GetOptions <HttpClientOptions>(httpClientSectionName);

            return(builder.AddConsul(consulOptions, httpClientOptions));
        }
Пример #3
0
        public static IConveyBuilder AddConsul(this IConveyBuilder 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));
        }
Пример #4
0
        public static IConveyBuilder AddInfrastructure(this IConveyBuilder builder)
        {
            builder.AddConsul();

            return(builder);
        }