Пример #1
0
 public static IDrexBuilder AddServiceClient <T>(this IDrexBuilder builder, string serviceName,
                                                 RestEaseOptions options, ConsulOptions consulOptions, FabioOptions fabioOptions,
                                                 HttpClientOptions httpClientOptions)
     where T : class
 {
     return(builder.AddServiceClient <T>(serviceName, options,
                                         b => b.AddFabio(fabioOptions, consulOptions, httpClientOptions)));
 }
Пример #2
0
        public static IDrexBuilder AddServiceClient <T>(this IDrexBuilder builder, string serviceName,
                                                        Func <IRestEaseOptionsBuilder, IRestEaseOptionsBuilder> buildOptions,
                                                        Func <IConsulOptionsBuilder, IConsulOptionsBuilder> buildConsulOptions,
                                                        Func <IFabioOptionsBuilder, IFabioOptionsBuilder> buildFabioOptions,
                                                        HttpClientOptions httpClientOptions)
            where T : class
        {
            var options = buildOptions(new RestEaseOptionsBuilder()).Build();

            return(builder.AddServiceClient <T>(serviceName, options,
                                                b => b.AddFabio(buildFabioOptions, buildConsulOptions, httpClientOptions)));
        }
Пример #3
0
        public static IDrexBuilder AddServiceClient <T>(this IDrexBuilder builder, string serviceName,
                                                        string sectionName           = SectionName, string consulSectionName = "consul", string fabioSectionName = "fabio",
                                                        string httpClientSectionName = "httpClient")
            where T : class
        {
            if (string.IsNullOrWhiteSpace(sectionName))
            {
                sectionName = SectionName;
            }

            var restEaseOptions = builder.GetOptions <RestEaseOptions>(sectionName);

            return(builder.AddServiceClient <T>(serviceName, restEaseOptions,
                                                b => b.AddFabio(fabioSectionName, consulSectionName, httpClientSectionName)));
        }