Implemented interface member:
property
Services
Microsoft.Extensions.Hosting.IHostApplicationBuilder.Services
193 references to Services
Aspire.Azure.Messaging.EventHubs.Tests (9)
AspireEventHubsExtensionsTests.cs (9)
78
ConfigureBlobServiceClient(useKeyed, builder.
Services
);
125
ConfigureBlobServiceClient(useKeyed, builder.
Services
);
194
ConfigureBlobServiceClient(useKeyed, builder.
Services
);
256
ConfigureBlobServiceClient(useKeyed, builder.
Services
);
322
ConfigureBlobServiceClient(useKeyed, builder.
Services
);
368
ConfigureBlobServiceClient(useKeyed, builder.
Services
);
416
ConfigureBlobServiceClient(useKeyed, builder.
Services
);
498
ConfigureBlobServiceClient(useKeyed, builder.
Services
);
559
ConfigureBlobServiceClient(useKeyed: false, builder.
Services
);
Aspire.Components.Common.Tests (3)
ConformanceTests.cs (3)
267
builder.
Services
.AddSingleton<ILoggerFactory, TestLoggerFactory>();
274
builder.
Services
.AddSingleton<ILoggerFactory, TestLoggerFactory>();
430
builder.
Services
.AddOpenTelemetry().WithTracing(builder => builder.AddInMemoryExporter(exportedActivities));
Aspire.Elastic.Clients.Elasticsearch.Tests (1)
AspireElasticClientExtensionsTest.cs (1)
152
builder.
Services
.AddOpenTelemetry().WithTracing(builder => builder.AddProcessor(notifier));
Aspire.Hosting (37)
DistributedApplicationBuilder.cs (36)
61
public 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)
135
hb.
Services
.AddXunitLogging(testOutputHelper);
192
hb.
Services
.AddXunitLogging(testOutputHelper);
Aspire.Hosting.Testing (1)
DistributedApplicationTestingBuilder.cs (1)
256
/// <inheritdoc cref="HostApplicationBuilder.
Services
" />
Aspire.Keycloak.Authentication.Tests (8)
AspireKeycloakExtensionTests.cs (8)
24
builder.
Services
.AddAuthentication()
44
builder.
Services
.AddAuthentication()
62
builder.
Services
.AddAuthentication()
84
builder.
Services
.AddAuthentication()
105
builder.
Services
.AddAuthentication()
125
builder.
Services
.AddAuthentication()
143
builder.
Services
.AddAuthentication()
166
builder.
Services
.AddAuthentication()
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (12)
AspireAzureEfCoreCosmosDBExtensionsTests.cs (4)
166
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseCosmos(ConnectionString, "databaseName"));
170
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseCosmos(ConnectionString, "databaseName"));
189
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseCosmos(ConnectionString, "databaseName"));
193
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseCosmos(ConnectionString, "databaseName"));
EnrichCosmosDbTests.cs (8)
23
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseCosmos(ConnectionString, DatabaseName));
41
builder.
Services
.AddDbContext<TestDbContext>(options => options.UseCosmos(ConnectionString, DatabaseName));
56
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
89
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder =>
106
builder.
Services
.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder =>
113
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
127
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder =>
148
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (21)
AspireSqlServerEFCoreSqlClientExtensionsTests.cs (4)
267
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseSqlServer(ConnectionString));
271
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseSqlServer(ConnectionString));
290
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseSqlServer(ConnectionString));
294
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseSqlServer(ConnectionString));
EnrichSqlServerTests.cs (17)
27
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseSqlServer(ConnectionString));
45
builder.
Services
.AddDbContext<TestDbContext>(options => options.UseSqlServer(ConnectionString));
63
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
98
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
118
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
123
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
153
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
161
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
167
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
196
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
204
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
230
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder =>
247
builder.
Services
.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder =>
254
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
268
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
296
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
313
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.NATS.Net.Tests (1)
AspireNatsClientExtensionsTests.cs (1)
218
builder.
Services
.AddOpenTelemetry().WithTracing(builder => builder.AddProcessor(notifier));
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (22)
AspireEFPostgreSqlExtensionsTests.cs (4)
274
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseNpgsql(ConnectionString));
278
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseNpgsql(ConnectionString));
297
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseNpgsql(ConnectionString));
301
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseNpgsql(ConnectionString));
EnrichNpgsqlTests.cs (18)
28
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseNpgsql(ConnectionString));
46
builder.
Services
.AddDbContext<TestDbContext>(options => options.UseNpgsql(ConnectionString));
64
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
100
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
121
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
127
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
157
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
166
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
172
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
201
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
210
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
237
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder =>
255
builder.
Services
.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder =>
263
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
277
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
306
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
324
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
357
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.Oracle.EntityFrameworkCore.Tests (23)
AspireOracleEFCoreDatabaseExtensionsTests.cs (4)
268
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseOracle(ConnectionString));
272
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString));
291
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseOracle(ConnectionString));
295
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString));
ConformanceTests.cs (1)
152
builder.
Services
.AddOpenTelemetry().WithTracing(builder =>
EnrichOracleDatabaseTests.cs (18)
28
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString));
46
builder.
Services
.AddDbContext<TestDbContext>(options => options.UseOracle(ConnectionString));
64
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
99
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
119
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
124
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
154
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
162
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
168
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
197
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
205
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
231
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder =>
248
builder.
Services
.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder =>
255
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
269
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
297
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
314
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
346
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (22)
AspireEFMySqlExtensionsTests.cs (4)
262
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseMySql(ConnectionString, s_serverVersion));
266
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseMySql(ConnectionString, s_serverVersion));
285
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseMySql(ConnectionString, s_serverVersion));
289
builder.
Services
.AddDbContextPool<TestDbContext>(options => options.UseMySql(ConnectionString, s_serverVersion));
EnrichMySqlTests.cs (18)
32
builder.
Services
.AddDbContextPool<TestDbContext>((serviceProvider, options) =>
59
builder.
Services
.AddDbContext<TestDbContext>(options => options.UseMySql(ConnectionString, DefaultVersion));
77
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
112
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
132
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
137
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
167
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
175
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
181
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
210
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
218
var oldOptionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
244
builder.
Services
.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder =>
261
builder.
Services
.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder =>
268
var optionsDescriptor = builder.
Services
.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
282
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
310
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
327
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
359
builder.
Services
.AddDbContextPool<TestDbContext>(optionsBuilder =>
Aspire.RabbitMQ.Client.Tests (5)
AspireRabbitMQLoggingTests.cs (5)
54
builder.
Services
.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger));
75
builder.
Services
.AddSingleton<RabbitMQEventSourceLogForwarder>();
78
builder.
Services
.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger));
104
builder.
Services
.AddSingleton<RabbitMQEventSourceLogForwarder>();
107
builder.
Services
.AddSingleton<ILoggerProvider>(sp => new LoggerProvider(logger));
Aspire.StackExchange.Redis.Tests (1)
AspireRedisExtensionsTests.cs (1)
43
builder.
Services
.Configure<ConfigurationOptions>(options =>
Consumer (1)
Program.cs (1)
12
builder.
Services
.AddHostedService<ConsumerWorker>();
DaprServiceC (2)
Program.cs (2)
12
builder.
Services
.AddSingleton<DaprClient>(dapr);
14
builder.
Services
.AddHostedService<Worker>();
DatabaseMigration.MigrationService (2)
Program.cs (2)
8
builder.
Services
.AddHostedService<ApiDbInitializer>();
12
builder.
Services
.AddOpenTelemetry()
EventHubsConsumer (2)
Program.cs (2)
19
builder.
Services
.AddHostedService<Consumer>();
32
builder.
Services
.AddHostedService<Processor>();
Microsoft.AspNetCore (8)
BootstrapHostBuilder.cs (5)
24
foreach (var descriptor in _builder.
Services
)
101
configureServicesAction(Context, _builder.
Services
);
106
for (int i = _builder.
Services
.Count - 1; i >= 0; i--)
108
var descriptor = _builder.
Services
[i];
114
_builder.
Services
.RemoveAt(i);
WebApplicationBuilder.cs (3)
106
AddDefaultServicesSlim(configuration, _hostApplicationBuilder.
Services
);
337
public 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)
8
builder.
Services
.AddHostedService<OrderProcessingWorker>();
Producer (2)
Program.cs (2)
13
builder.
Services
.AddHostedService<IntermittentProducerWorker>();
14
builder.
Services
.AddHostedService<ContinuousProducerWorker>();
Stress.TelemetryService (3)
Program.cs (3)
7
builder.
Services
.AddHostedService<TelemetryStresser>();
8
builder.
Services
.AddHostedService<GaugeMetrics>();
13
builder.
Services
.AddOpenTelemetry()
TestProject.WorkerA (1)
Program.cs (1)
7
builder.
Services
.AddHostedService<Worker>();