Implemented interface member:
property
Services
Microsoft.Extensions.Hosting.IHostApplicationBuilder.Services
193 references to Services
Aspire.Azure.Messaging.EventHubs.Tests (9)
AspireEventHubsExtensionsTests.cs (9)
78ConfigureBlobServiceClient(useKeyed, builder.Services); 125ConfigureBlobServiceClient(useKeyed, builder.Services); 194ConfigureBlobServiceClient(useKeyed, builder.Services); 256ConfigureBlobServiceClient(useKeyed, builder.Services); 322ConfigureBlobServiceClient(useKeyed, builder.Services); 368ConfigureBlobServiceClient(useKeyed, builder.Services); 416ConfigureBlobServiceClient(useKeyed, builder.Services); 498ConfigureBlobServiceClient(useKeyed, builder.Services); 559ConfigureBlobServiceClient(useKeyed: false, builder.Services);
Aspire.Components.Common.Tests (3)
ConformanceTests.cs (3)
267builder.Services.AddSingleton<ILoggerFactory, TestLoggerFactory>(); 274builder.Services.AddSingleton<ILoggerFactory, TestLoggerFactory>(); 430builder.Services.AddOpenTelemetry().WithTracing(builder => builder.AddInMemoryExporter(exportedActivities));
Aspire.Elastic.Clients.Elasticsearch.Tests (1)
AspireElasticClientExtensionsTest.cs (1)
152builder.Services.AddOpenTelemetry().WithTracing(builder => builder.AddProcessor(notifier));
Aspire.Hosting (37)
DistributedApplicationBuilder.cs (36)
61public IServiceCollection Services => _innerBuilder.Services; 199_innerBuilder.Services.AddSingleton(sp => new DistributedApplicationModel(Resources)); 200_innerBuilder.Services.AddHostedService<DistributedApplicationLifecycle>(); 201_innerBuilder.Services.AddHostedService<DistributedApplicationRunner>(); 202_innerBuilder.Services.AddSingleton(options); 203_innerBuilder.Services.AddSingleton<ResourceNotificationService>(); 204_innerBuilder.Services.AddSingleton<ResourceLoggerService>(); 205_innerBuilder.Services.AddSingleton<IDistributedApplicationEventing>(Eventing); 206_innerBuilder.Services.AddHealthChecks(); 266_innerBuilder.Services.AddSingleton<DashboardCommandExecutor>(); 267_innerBuilder.Services.AddOptions<TransportOptions>().ValidateOnStart().PostConfigure(MapTransportOptionsFromCustomKeys); 268_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<TransportOptions>, TransportOptionsValidator>()); 269_innerBuilder.Services.AddSingleton<DashboardServiceHost>(); 270_innerBuilder.Services.AddHostedService(sp => sp.GetRequiredService<DashboardServiceHost>()); 271_innerBuilder.Services.AddSingleton<IDashboardEndpointProvider, HostDashboardEndpointProvider>(); 272_innerBuilder.Services.AddLifecycleHook<DashboardLifecycleHook>(); 273_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<DashboardOptions>, ConfigureDefaultDashboardOptions>()); 274_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<DashboardOptions>, ValidateDashboardOptions>()); 278_innerBuilder.Services.AddSingleton<ApplicationExecutor>(); 279_innerBuilder.Services.AddSingleton<IDcpDependencyCheckService, DcpDependencyCheck>(); 280_innerBuilder.Services.AddHostedService<DcpHostService>(); 281_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<DcpOptions>, ConfigureDefaultDcpOptions>()); 282_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<DcpOptions>, ValidateDcpOptions>()); 283_innerBuilder.Services.AddSingleton<DcpNameGenerator>(); 286_innerBuilder.Services.AddSingleton(new Locations()); 287_innerBuilder.Services.AddSingleton<IKubernetesService, KubernetesService>(); 290_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<CodespacesOptions>, ConfigureCodespacesOptions>()); 291_innerBuilder.Services.AddSingleton<CodespacesUrlRewriter>(); 292_innerBuilder.Services.AddHostedService<CodespacesResourceUrlRewriterService>(); 299_innerBuilder.Services.AddKeyedSingleton<IDistributedApplicationPublisher, ManifestPublisher>("manifest"); 309_innerBuilder.Services.AddSingleton(ExecutionContext); 315_innerBuilder.Services.AddSingleton<IValidateOptions<HealthCheckServiceOptions>>(sp => 344_innerBuilder.Services.AddSingleton<IConfigureOptions<HealthCheckPublisherOptions>>(sp => 358_innerBuilder.Services.AddSingleton<ResourceHealthCheckService>(); 359_innerBuilder.Services.AddHostedService<ResourceHealthCheckService>(sp => sp.GetRequiredService<ResourceHealthCheckService>()); 388_innerBuilder.Services.Configure<PublishingOptions>(_innerBuilder.Configuration.GetSection(PublishingOptions.Publishing));
IDistributedApplicationBuilder.cs (1)
71/// <inheritdoc cref="HostApplicationBuilder.Services" />
Aspire.Hosting.RabbitMQ.Tests (2)
RabbitMQFunctionalTests.cs (2)
135hb.Services.AddXunitLogging(testOutputHelper); 192hb.Services.AddXunitLogging(testOutputHelper);
Aspire.Hosting.Testing (1)
DistributedApplicationTestingBuilder.cs (1)
256/// <inheritdoc cref="HostApplicationBuilder.Services" />
Aspire.Keycloak.Authentication.Tests (8)
AspireKeycloakExtensionTests.cs (8)
24builder.Services.AddAuthentication() 44builder.Services.AddAuthentication() 62builder.Services.AddAuthentication() 84builder.Services.AddAuthentication() 105builder.Services.AddAuthentication() 125builder.Services.AddAuthentication() 143builder.Services.AddAuthentication() 166builder.Services.AddAuthentication()
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (12)
AspireAzureEfCoreCosmosDBExtensionsTests.cs (4)
166builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseCosmos(ConnectionString, "databaseName")); 170builder.Services.AddDbContextPool<TestDbContext>(options => options.UseCosmos(ConnectionString, "databaseName")); 189builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseCosmos(ConnectionString, "databaseName")); 193builder.Services.AddDbContextPool<TestDbContext>(options => options.UseCosmos(ConnectionString, "databaseName"));
EnrichCosmosDbTests.cs (8)
23builder.Services.AddDbContextPool<TestDbContext>(options => options.UseCosmos(ConnectionString, DatabaseName)); 41builder.Services.AddDbContext<TestDbContext>(options => options.UseCosmos(ConnectionString, DatabaseName)); 56builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 89builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder => 106builder.Services.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder => 113var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 127builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder => 148builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (21)
AspireSqlServerEFCoreSqlClientExtensionsTests.cs (4)
267builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseSqlServer(ConnectionString)); 271builder.Services.AddDbContextPool<TestDbContext>(options => options.UseSqlServer(ConnectionString)); 290builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseSqlServer(ConnectionString)); 294builder.Services.AddDbContextPool<TestDbContext>(options => options.UseSqlServer(ConnectionString));
EnrichSqlServerTests.cs (17)
27builder.Services.AddDbContextPool<TestDbContext>(options => options.UseSqlServer(ConnectionString)); 45builder.Services.AddDbContext<TestDbContext>(options => options.UseSqlServer(ConnectionString)); 63builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 98builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 118builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 123var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 153builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 161var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 167var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 196builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 204var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 230builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder => 247builder.Services.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder => 254var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 268builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 296builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 313builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.NATS.Net.Tests (1)
AspireNatsClientExtensionsTests.cs (1)
218builder.Services.AddOpenTelemetry().WithTracing(builder => builder.AddProcessor(notifier));
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (22)
AspireEFPostgreSqlExtensionsTests.cs (4)
274builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseNpgsql(ConnectionString)); 278builder.Services.AddDbContextPool<TestDbContext>(options => options.UseNpgsql(ConnectionString)); 297builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseNpgsql(ConnectionString)); 301builder.Services.AddDbContextPool<TestDbContext>(options => options.UseNpgsql(ConnectionString));
EnrichNpgsqlTests.cs (18)
28builder.Services.AddDbContextPool<TestDbContext>(options => options.UseNpgsql(ConnectionString)); 46builder.Services.AddDbContext<TestDbContext>(options => options.UseNpgsql(ConnectionString)); 64builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 100builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 121builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 127var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 157builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 166var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 172var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 201builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 210var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 237builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder => 255builder.Services.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder => 263var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 277builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 306builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 324builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 357builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.Oracle.EntityFrameworkCore.Tests (23)
AspireOracleEFCoreDatabaseExtensionsTests.cs (4)
268builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseOracle(ConnectionString)); 272builder.Services.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString)); 291builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseOracle(ConnectionString)); 295builder.Services.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString));
ConformanceTests.cs (1)
152builder.Services.AddOpenTelemetry().WithTracing(builder =>
EnrichOracleDatabaseTests.cs (18)
28builder.Services.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString)); 46builder.Services.AddDbContext<TestDbContext>(options => options.UseOracle(ConnectionString)); 64builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 99builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 119builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 124var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 154builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 162var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 168var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 197builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 205var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 231builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder => 248builder.Services.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder => 255var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 269builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 297builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 314builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 346builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (22)
AspireEFMySqlExtensionsTests.cs (4)
262builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseMySql(ConnectionString, s_serverVersion)); 266builder.Services.AddDbContextPool<TestDbContext>(options => options.UseMySql(ConnectionString, s_serverVersion)); 285builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseMySql(ConnectionString, s_serverVersion)); 289builder.Services.AddDbContextPool<TestDbContext>(options => options.UseMySql(ConnectionString, s_serverVersion));
EnrichMySqlTests.cs (18)
32builder.Services.AddDbContextPool<TestDbContext>((serviceProvider, options) => 59builder.Services.AddDbContext<TestDbContext>(options => options.UseMySql(ConnectionString, DefaultVersion)); 77builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 112builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 132builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 137var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 167builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 175var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 181var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 210builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 218var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 244builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder => 261builder.Services.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder => 268var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 282builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 310builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 327builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 359builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.RabbitMQ.Client.Tests (5)
AspireRabbitMQLoggingTests.cs (5)
54builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger)); 75builder.Services.AddSingleton<RabbitMQEventSourceLogForwarder>(); 78builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger)); 104builder.Services.AddSingleton<RabbitMQEventSourceLogForwarder>(); 107builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger));
Aspire.StackExchange.Redis.Tests (1)
AspireRedisExtensionsTests.cs (1)
43builder.Services.Configure<ConfigurationOptions>(options =>
Consumer (1)
Program.cs (1)
12builder.Services.AddHostedService<ConsumerWorker>();
DaprServiceC (2)
Program.cs (2)
12builder.Services.AddSingleton<DaprClient>(dapr); 14builder.Services.AddHostedService<Worker>();
DatabaseMigration.MigrationService (2)
Program.cs (2)
8builder.Services.AddHostedService<ApiDbInitializer>(); 12builder.Services.AddOpenTelemetry()
EventHubsConsumer (2)
Program.cs (2)
19builder.Services.AddHostedService<Consumer>(); 32builder.Services.AddHostedService<Processor>();
Microsoft.AspNetCore (8)
BootstrapHostBuilder.cs (5)
24foreach (var descriptor in _builder.Services) 101configureServicesAction(Context, _builder.Services); 106for (int i = _builder.Services.Count - 1; i >= 0; i--) 108var descriptor = _builder.Services[i]; 114_builder.Services.RemoveAt(i);
WebApplicationBuilder.cs (3)
106AddDefaultServicesSlim(configuration, _hostApplicationBuilder.Services); 337public IServiceCollection Services => _hostApplicationBuilder.Services; 380_hostApplicationBuilder.Services.Add(_genericWebHostServiceDescriptor);
Microsoft.Extensions.Hosting.Systemd (1)
SystemdHostBuilderExtensions.cs (1)
64/// For example, <see cref="HostApplicationBuilder.Services"/> or the <see cref="IServiceCollection"/> passed to the
Microsoft.Extensions.Hosting.WindowsServices (2)
WindowsServiceLifetimeHostBuilderExtensions.cs (2)
71/// For example, <see cref="HostApplicationBuilder.Services"/> or the <see cref="IServiceCollection"/> passed to the 90/// For example, <see cref="HostApplicationBuilder.Services"/> or the <see cref="IServiceCollection"/> passed to the
OrderProcessor (1)
Program.cs (1)
8builder.Services.AddHostedService<OrderProcessingWorker>();
Producer (2)
Program.cs (2)
13builder.Services.AddHostedService<IntermittentProducerWorker>(); 14builder.Services.AddHostedService<ContinuousProducerWorker>();
Stress.TelemetryService (3)
Program.cs (3)
7builder.Services.AddHostedService<TelemetryStresser>(); 8builder.Services.AddHostedService<GaugeMetrics>(); 13builder.Services.AddOpenTelemetry()
TestProject.WorkerA (1)
Program.cs (1)
7builder.Services.AddHostedService<Worker>();