예제 #1
0
        public static IFixerBuilder AddServiceClient <T>(this IFixerBuilder builder, string serviceName,
                                                         string sectionName           = SectionName, string consulSectionName = "consul", string fabioSectionName = "fabio",
                                                         string httpClientSectionName = "httpClient")
            where T : class
        {
            var restEaseOptions = builder.GetOptions <RestEaseOptions>(sectionName);

            return(builder.AddServiceClient <T>(serviceName, restEaseOptions,
                                                b => b.AddFabio(fabioSectionName, consulSectionName, httpClientSectionName)));
        }
예제 #2
0
        public static IFixerBuilder AddServiceClient <T>(this IFixerBuilder 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 IFixerBuilder AddServiceClient <T>(this IFixerBuilder builder, string serviceName,
                                                  RestEaseOptions options, ConsulOptions consulOptions, FabioOptions fabioOptions,
                                                  HttpClientOptions httpClientOptions)
     where T : class
 => builder.AddServiceClient <T>(serviceName, options,
                                 b => b.AddFabio(fabioOptions, consulOptions, httpClientOptions));