Example #1
0
        public static IBioWorldBuilder AddServiceClient <T>(this IBioWorldBuilder 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)));
        }
Example #2
0
        public static IBioWorldBuilder AddServiceClient <T>(this IBioWorldBuilder 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)));
        }
Example #3
0
 public static IBioWorldBuilder AddServiceClient <T>(this IBioWorldBuilder 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));