1 implementation of Services
Microsoft.Extensions.Http (1)
DependencyInjection\DefaultHttpClientBuilder.cs (1)
23public IServiceCollection Services { get; }
101 references to Services
Microsoft.AspNetCore.HeaderPropagation (2)
DependencyInjection\HeaderPropagationHttpClientBuilderExtensions.cs (2)
26builder.Services.AddHeaderPropagation(); 56builder.Services.AddHeaderPropagation();
Microsoft.Extensions.Http (26)
DependencyInjection\HttpClientBuilderExtensions.cs (23)
33builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => options.HttpClientActions.Add(configureClient)); 53builder.Services.AddTransient<IConfigureOptions<HttpClientFactoryOptions>>(services => 79builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 108builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 135builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 159builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 189builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 217builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 243builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 264builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => options.HttpMessageHandlerBuilderActions.Add(configureBuilder)); 290builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 329configureBuilder(new DefaultSocketsHttpHandlerBuilder(builder.Services, builder.Name)); 375builder.Services.AddTransient(s => AddTransientHelper<TClient>(s, builder)); 439builder.Services.AddTransient(s => AddTransientHelper<TClient, TImplementation>(s, builder)); 490builder.Services.AddTransient<TClient>(s => 539builder.Services.AddTransient<TClient>(s => 563builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 582builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 625builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => options.HandlerLifetime = handlerLifetime); 641builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 692IServiceCollection services = builder.Services; 734IServiceCollection services = builder.Services; 762HttpClientMappingRegistry registry = GetMappingRegistry(builder.Services);
DependencyInjection\HttpClientBuilderExtensions.Logging.cs (3)
51builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 125builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => 143builder.Services.Configure<HttpClientFactoryOptions>(builder.Name, options => options.SuppressDefaultLogging = false);
Microsoft.Extensions.Http.Diagnostics (5)
Logging\HttpClientLoggingHttpClientBuilderExtensions.cs (5)
82var optionsBuilder = builder.Services 87_ = builder.Services 92builder.Services.TryAddKeyedSingleton<HttpClientLogger>(builder.Name); 93builder.Services.TryAddKeyedSingleton<IHttpRequestReader, HttpRequestReader>(builder.Name); 94builder.Services.TryAddKeyedSingleton<IHttpHeadersReader, HttpHeadersReader>(builder.Name);
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (8)
HttpClientFactory.cs (8)
32.Services 55.Services 82.Services 105.Services 128.Services 155.Services 166.Services 176.Services
Microsoft.Extensions.Http.Diagnostics.Tests (28)
Logging\AcceptanceTests.cs (19)
102.AddHttpClient("testClient").Services 145}).Services 155}).Services 225}).Services 236}).Services 415.Services 455.Services 462.Services 491.Services 498.Services 525.Services 531.Services 537.Services 543.Services 549.Services 586.Services 608.Services 610.Services 671.Services
Logging\HttpClientLoggingExtensionsTest.cs (9)
87.Services 90.Services 110.Services 113.Services 133.Services 136.Services 232.Services 343}).Services 364.Services.BuildServiceProvider();
Microsoft.Extensions.Http.Resilience (12)
Hedging\ResilienceHttpClientBuilderExtensions.Hedging.cs (6)
76var routingBuilder = new RoutingStrategyBuilder(builder.Name, builder.Services); 78builder.Services.TryAddSingleton<Randomizer>(); 80_ = builder.Services.AddOptionsWithValidateOnStart<HttpStandardHedgingResilienceOptions, HttpStandardHedgingResilienceOptionsValidator>(optionsName); 81_ = builder.Services.AddOptionsWithValidateOnStart<HttpStandardHedgingResilienceOptions, HttpStandardHedgingResilienceOptionsCustomValidator>(optionsName); 82_ = builder.Services.PostConfigure<HttpStandardHedgingResilienceOptions>(optionsName, options => 146return new StandardHedgingHandlerBuilder(builder.Name, builder.Services, routingBuilder);
Resilience\ResilienceHttpClientBuilderExtensions.Resilience.cs (3)
118_ = builder.Services.AddResiliencePipeline<HttpKey, HttpResponseMessage>(key, (builder, context) => configure(builder, new ResilienceHandlerContext(context))); 120ConfigureHttpServices(builder.Services); 122return new(pipelineName, builder.Services);
Resilience\ResilienceHttpClientBuilderExtensions.StandardResilience.cs (3)
72_ = builder.Services.AddOptionsWithValidateOnStart<HttpStandardResilienceOptions, HttpStandardResilienceOptionsCustomValidator>(optionsName); 73_ = builder.Services.AddOptionsWithValidateOnStart<HttpStandardResilienceOptions, HttpStandardResilienceOptionsValidator>(optionsName); 93return new HttpStandardResiliencePipelineBuilder(optionsName, builder.Services);
Microsoft.Extensions.Http.Resilience.PerformanceTests (2)
HttpClientFactory.cs (2)
46.Services 49.Services
Microsoft.Extensions.Http.Resilience.Tests (16)
Resilience\HttpClientBuilderExtensionsTests.BySelector.cs (7)
28_builder.Services.AddFakeRedaction(); 36var provider = _builder.Services.BuildServiceProvider().GetPipelineKeyProvider(pipelineName)!; 49_builder.Services.AddFakeRedaction(); 65_builder.Services.AddFakeRedaction(); 82var provider = _builder.Services.BuildServiceProvider().GetPipelineKeyProvider(pipelineName)!; 113_builder.Services.AddFakeRedaction(); 114_builder.Services.TryAddSingleton(provider.Object);
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (3)
93var count = builder.Services.Count; 106builder.Services.Should().HaveCount(count + 2); 173using var serviceProvider = builder.Services.BuildServiceProvider();
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (6)
32_builder.Services.AddMetrics(); 33_builder.Services.AddLogging(); 59_serviceProvider ??= _builder.Services.BuildServiceProvider(); 150Assert.Throws<InvalidOperationException>(() => HttpClientBuilderExtensionsTests.GetPipeline(builder.Services, "test-standard")); 197Assert.Throws<OptionsValidationException>(() => GetPipeline(builder.Services, "test-standard")); 215var pipeline = GetPipeline(builder.Services, "test-standard");
Microsoft.Extensions.ServiceDiscovery (2)
ServiceDiscoveryHttpClientBuilderExtensions.cs (2)
24var services = httpClientBuilder.Services; 37AddDisableGrpcLoadBalancingFilter(httpClientBuilder.Services, httpClientBuilder.Name);