Implemented interface member:
property
Services
Microsoft.Extensions.Hosting.IHostApplicationBuilder.Services
212 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.Confluent.Kafka.Tests (2)
OtelMetricsTests.cs (1)
61builder.Services.AddOpenTelemetry().WithMetrics(meterProvider => meterProvider.AddInMemoryExporter(metrics));
OtelTracesTests.cs (1)
63builder.Services.AddOpenTelemetry().WithTracing(traceProviderBuilder => traceProviderBuilder.AddInMemoryExporter(activities));
Aspire.Elastic.Clients.Elasticsearch.Tests (1)
AspireElasticClientExtensionsTest.cs (1)
152builder.Services.AddOpenTelemetry().WithTracing(builder => builder.AddProcessor(notifier));
Aspire.Hosting (45)
DistributedApplicationBuilder.cs (44)
63public IServiceCollection Services => _innerBuilder.Services; 137_innerBuilder.Services.AddSingleton(TimeProvider.System); 197_innerBuilder.Services.AddSingleton(sp => new DistributedApplicationModel(Resources)); 198_innerBuilder.Services.AddHostedService<DistributedApplicationLifecycle>(); 199_innerBuilder.Services.AddHostedService<DistributedApplicationRunner>(); 200_innerBuilder.Services.AddSingleton(options); 201_innerBuilder.Services.AddSingleton<ResourceNotificationService>(); 202_innerBuilder.Services.AddSingleton<ResourceLoggerService>(); 203_innerBuilder.Services.AddSingleton<IDistributedApplicationEventing>(Eventing); 204_innerBuilder.Services.AddHealthChecks(); 264_innerBuilder.Services.AddSingleton<DashboardCommandExecutor>(); 265_innerBuilder.Services.AddOptions<TransportOptions>().ValidateOnStart().PostConfigure(MapTransportOptionsFromCustomKeys); 266_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<TransportOptions>, TransportOptionsValidator>()); 267_innerBuilder.Services.AddSingleton<DashboardServiceHost>(); 268_innerBuilder.Services.AddHostedService(sp => sp.GetRequiredService<DashboardServiceHost>()); 269_innerBuilder.Services.AddSingleton<IDashboardEndpointProvider, HostDashboardEndpointProvider>(); 270_innerBuilder.Services.AddLifecycleHook<DashboardLifecycleHook>(); 271_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<DashboardOptions>, ConfigureDefaultDashboardOptions>()); 272_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<DashboardOptions>, ValidateDashboardOptions>()); 278_innerBuilder.Services.AddHostedService<ResourceLoggerForwarderService>(); 282_innerBuilder.Services.AddSingleton<ApplicationOrchestrator>(); 283_innerBuilder.Services.AddHostedService<OrchestratorHostService>(); 286_innerBuilder.Services.AddSingleton<IDcpExecutor, DcpExecutor>(); 287_innerBuilder.Services.AddSingleton<DcpExecutorEvents>(); 288_innerBuilder.Services.AddSingleton<DcpHost>(); 289_innerBuilder.Services.AddSingleton<IDcpDependencyCheckService, DcpDependencyCheck>(); 290_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<DcpOptions>, ConfigureDefaultDcpOptions>()); 291_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<DcpOptions>, ValidateDcpOptions>()); 292_innerBuilder.Services.AddSingleton<DcpNameGenerator>(); 295_innerBuilder.Services.AddSingleton(new Locations()); 296_innerBuilder.Services.AddSingleton<IKubernetesService, KubernetesService>(); 299_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<CodespacesOptions>, ConfigureCodespacesOptions>()); 300_innerBuilder.Services.AddSingleton<CodespacesUrlRewriter>(); 301_innerBuilder.Services.AddHostedService<CodespacesResourceUrlRewriterService>(); 302_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<DevcontainersOptions>, ConfigureDevcontainersOptions>()); 303_innerBuilder.Services.AddSingleton<DevcontainerSettingsWriter>(); 304_innerBuilder.Services.TryAddLifecycleHook<DevcontainerPortForwardingLifecycleHook>(); 311_innerBuilder.Services.AddKeyedSingleton<IDistributedApplicationPublisher, ManifestPublisher>("manifest"); 321_innerBuilder.Services.AddSingleton(ExecutionContext); 327_innerBuilder.Services.AddSingleton<IValidateOptions<HealthCheckServiceOptions>>(sp => 356_innerBuilder.Services.AddSingleton<IConfigureOptions<HealthCheckPublisherOptions>>(sp => 370_innerBuilder.Services.AddSingleton<ResourceHealthCheckService>(); 371_innerBuilder.Services.AddHostedService<ResourceHealthCheckService>(sp => sp.GetRequiredService<ResourceHealthCheckService>()); 400_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)
259/// <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 (7)
AspireRabbitMQLoggingTests.cs (7)
59builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger)); 80builder.Services.AddSingleton<RabbitMQEventSourceLogForwarder>(); 83builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger)); 109builder.Services.AddSingleton<RabbitMQEventSourceLogForwarder>(); 112builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger)); 154builder.Services.AddSingleton<RabbitMQEventSourceLogForwarder>(); 157builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger));
Aspire.RabbitMQ.Client.v7.Tests (7)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (7)
59builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger)); 80builder.Services.AddSingleton<RabbitMQEventSourceLogForwarder>(); 83builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger)); 109builder.Services.AddSingleton<RabbitMQEventSourceLogForwarder>(); 112builder.Services.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger)); 154builder.Services.AddSingleton<RabbitMQEventSourceLogForwarder>(); 157builder.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>();
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>();
ServiceBusWorker (2)
Program.cs (2)
9builder.Services.AddHostedService<Consumer>(); 10builder.Services.AddHostedService<Producer>();
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>();