Beispiel #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            FlagrOptions flagrOptions = new FlagrOptions();

            Configuration.Bind("Flagr", flagrOptions);
            services
            .AddFlaggerClient(flagrOptions)
            .AddControllers();
        }
Beispiel #2
0
        public static IServiceCollection AddFlaggerClient(this IServiceCollection services, FlagrOptions options)
        {
            services.AddRefitClient <IFlagrClient>()
            .ConfigureHttpClient(client =>
            {
                client.BaseAddress = new Uri(options.Uri);
            });

            services.AddTransient <IFlagger, Flagger>();

            return(services);
        }