Implemented interface member:
property
Services
Microsoft.Extensions.Hosting.IHost.Services
437 references to Services
Aspire.Hosting (2)
DistributedApplication.cs (1)
231/// exposes a <see cref="Services"/> property which allows developers to get services from the
DistributedApplicationBuilder.cs (1)
568_executionContextOptions.ServiceProvider = application.Services.GetRequiredService<IServiceProvider>();
Aspire.Hosting.Azure.Tests (113)
AzureAIFoundryExtensionsTests.cs (3)
88var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 93var foundryManager = app.Services.GetRequiredService<FoundryLocalManager>(); 140var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureAppConfigurationExtensionsTests.cs (1)
23var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureAppServiceTests.cs (8)
35var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 64var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 91var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 128var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 156var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 194var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 231var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 272var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureBicepProvisionerTests.cs (2)
59var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 63var rns = app.Services.GetRequiredService<ResourceNotificationService>();
AzureBicepResourceTests.cs (1)
78var hooks = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
AzureContainerAppsTests.cs (39)
36var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 70var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 100var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 142var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 174var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 218var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 248var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 319var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 396var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 435var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 465var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 501var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 537var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 575var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 615var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 647var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 680var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 762var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 805var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 836var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 868var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 897var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 934var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 978var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1019var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1057var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1078var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1097var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1117var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1136var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1155var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1173var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1204var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1260var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1311var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1381var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1403var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1433var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 1479var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureContainerRegistryTests.cs (3)
28var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 50var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 86var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureCosmosDBEmulatorFunctionalTests.cs (3)
172var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 220var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 289var rns = app.Services.GetRequiredService<ResourceNotificationService>();
AzureCosmosDBExtensionsTests.cs (3)
202var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 296var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 333var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureEventHubsExtensionsTests.cs (4)
289var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 353var configFiles = await configAnnotation.Callback(new ContainerFileSystemCallbackContext { Model = eventHubsEmulatorResource, ServiceProvider = app.Services }, CancellationToken.None); 414var configFiles = await configAnnotation.Callback(new ContainerFileSystemCallbackContext { Model = eventHubsEmulatorResource, ServiceProvider = app.Services }, CancellationToken.None); 488var configFiles = await configAnnotation.Callback(new ContainerFileSystemCallbackContext { Model = eventHubsEmulatorResource, ServiceProvider = app.Services }, CancellationToken.None);
AzureFunctionsTests.cs (7)
160var model = host.Services.GetRequiredService<DistributedApplicationModel>(); 186var model = host.Services.GetRequiredService<DistributedApplicationModel>(); 284var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 314var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 343var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 371var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 401var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureKeyVaultTests.cs (1)
35var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureOpenAIExtensionsTests.cs (1)
60var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzurePostgresExtensionsTests.cs (2)
36var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 59var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureRedisExtensionsTests.cs (2)
38var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 58var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureResourcePreparerTests.cs (3)
61var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 107var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 151var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureSearchExtensionsTests.cs (1)
40var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureServiceBusExtensionsTests.cs (6)
135var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 369var configFiles = await configAnnotation.Callback(new ContainerFileSystemCallbackContext { Model = serviceBusEmulatorResource, ServiceProvider = app.Services }, CancellationToken.None); 468var configFiles = await configAnnotation.Callback(new ContainerFileSystemCallbackContext { Model = serviceBusEmulatorResource, ServiceProvider = app.Services }, CancellationToken.None); 524var configFiles = await configAnnotation.Callback(new ContainerFileSystemCallbackContext { Model = serviceBusEmulatorResource, ServiceProvider = app.Services }, CancellationToken.None); 583var configFiles = await configAnnotation.Callback(new ContainerFileSystemCallbackContext { Model = serviceBusEmulatorResource, ServiceProvider = app.Services }, CancellationToken.None); 726var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureSignalRExtensionsTests.cs (2)
21var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 43var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureStorageEmulatorFunctionalTests.cs (6)
47var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 92var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 136var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 189var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 223var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 262var rns = app.Services.GetRequiredService<ResourceNotificationService>();
AzureStorageExtensionsTests.cs (1)
634var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureUserAssignedIdentityTests.cs (7)
30var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 49var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 70var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 115var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 152var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 207var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 283var model = app.Services.GetRequiredService<DistributedApplicationModel>();
AzureWebPubSubExtensionsTests.cs (1)
287var model = app.Services.GetRequiredService<DistributedApplicationModel>();
ContainerRegistryTests.cs (4)
29var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 59var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 97var publisher = app.Services.GetRequiredKeyedService<IDistributedApplicationPublisher>("test-publisher") as ContainerRegistryValidatingPublisher; 99var model = app.Services.GetRequiredService<DistributedApplicationModel>();
ExistingAzureResourceTests.cs (1)
76var model = app.Services.GetRequiredService<DistributedApplicationModel>();
RoleAssignmentTests.cs (1)
207var model = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.Containers.Tests (15)
ContainerResourceTests.cs (10)
21var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 40var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 59var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 79var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 154var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 188var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 216var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 235var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 284var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 331var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources());
WithDockerfileTests.cs (5)
76var collector = app.Services.GetFakeLogCollector(); 188var kubernetes = app.Services.GetRequiredService<IKubernetesService>(); 220var kubernetes = app.Services.GetRequiredService<IKubernetesService>(); 448var kubernetes = app.Services.GetRequiredService<IKubernetesService>(); 518var kubernetes = app.Services.GetRequiredService<IKubernetesService>();
Aspire.Hosting.Docker.Tests (1)
DockerComposePublisherTests.cs (1)
186var mockImageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>() as MockImageBuilder;
Aspire.Hosting.Garnet.Tests (6)
AddGarnetTests.cs (6)
22var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 50var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 79var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 343var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 364var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 381var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.Kafka.Tests (2)
AddKafkaTests.cs (2)
22var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 64var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.Keycloak.Tests (3)
KeycloakPublicApiTests.cs (2)
167var entries = await containerAnnotation.Callback(new() { Model = keycloakResource, ServiceProvider = app.Services }, CancellationToken.None); 194var entries = await containerAnnotation.Callback(new() { Model = keycloakResource, ServiceProvider = app.Services }, CancellationToken.None);
KeycloakResourceBuilderTests.cs (1)
23var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.Milvus.Tests (3)
AddMilvusTests.cs (3)
25var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 55var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 184var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.MongoDB.Tests (3)
AddMongoDBTests.cs (3)
23var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 51var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 82var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.MySql.Tests (8)
AddMySqlTests.cs (7)
43var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 82var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 120var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 139var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 243await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services)); 271var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 274builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services));
MySqlFunctionalTests.cs (1)
576var rns = app.Services.GetRequiredService<ResourceNotificationService>();
Aspire.Hosting.Nats.Tests (4)
AddNatsTests.cs (4)
46var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 75var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 93var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 135var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.Oracle.Tests (5)
AddOracleTests.cs (5)
42var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 81var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 119var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 139var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 162var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.PostgreSQL.Tests (9)
AddPostgresTests.cs (8)
52var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 106var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 174var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 196var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 377var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 476var entries = await createServers.Callback(new() { Model = pgadmin, ServiceProvider = app.Services }, CancellationToken.None); 526var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 536var entries = await createBookmarks.Callback(new() { Model = pgweb, ServiceProvider = app.Services }, CancellationToken.None);
PostgresFunctionalTests.cs (1)
562var rns = app.Services.GetRequiredService<ResourceNotificationService>();
Aspire.Hosting.Python.Tests (3)
AddPythonAppTests.cs (3)
144var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 180var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 219var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.Qdrant.Tests (4)
AddQdrantTests.cs (4)
45var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 84var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 117var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 283var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.RabbitMQ.Tests (3)
AddRabbitMQTests.cs (3)
50var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 102var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 141var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.Redis.Tests (15)
AddRedisTests.cs (10)
30var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 58var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 89var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 106var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 121var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 463var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 492await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 516await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 537await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 687var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
RedisFunctionalTests.cs (5)
144var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 476var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 511var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 612var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 622var clientFactory = app.Services.GetRequiredService<IHttpClientFactory>();
Aspire.Hosting.Seq.Tests (3)
AddSeqTests.cs (3)
21var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 49var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 78var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.SqlServer.Tests (4)
AddSqlServerTests.cs (4)
43var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 90var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 112var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 276var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Hosting.Testing (6)
DistributedApplicationFactory.cs (2)
172_shutdownTimeout = application.Services.GetService<IOptions<HostOptions>>()?.Value.ShutdownTimeout ?? _shutdownTimeout; 428_hostApplicationLifetime = app.Services.GetService<IHostApplicationLifetime>()
DistributedApplicationHostingTestingExtensions.cs (3)
29var clientFactory = app.Services.GetRequiredService<IHttpClientFactory>(); 78var applicationModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 119var lifetime = app.Services.GetRequiredService<IHostApplicationLifetime>();
DistributedApplicationTestingBuilder.cs (1)
290public IServiceProvider Services => innerApp.Services;
Aspire.Hosting.Testing.Tests (11)
TestingBuilderTests.cs (4)
99var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 161var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 398var hostEnvironment = app.Services.GetRequiredService<IHostEnvironment>(); 414var config = app.Services.GetRequiredService<IConfiguration>();
TestingFactoryTests.cs (3)
43var appModel = _app.Services.GetRequiredService<DistributedApplicationModel>(); 65var appModel = _app.Services.GetRequiredService<IHostEnvironment>(); 74var config = _app.Services.GetRequiredService<IConfiguration>();
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (4)
35var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 78var hostApplicationLifetime = app.Services.GetRequiredService<IHostApplicationLifetime>(); 124var resourceLoggerService = app.Services.GetRequiredService<ResourceLoggerService>(); 125var logger = app.Services.GetRequiredService<ILoggerFactory>().CreateLogger(nameof(LoggerNotificationExtensions));
Aspire.Hosting.Tests (196)
AddParameterTests.cs (9)
25var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 62var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 96var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 146var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 203var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 268var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 298var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 336var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 375var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
AspireStoreTests.cs (3)
36var store = app.Services.GetRequiredService<IAspireStore>(); 60var store = app.Services.GetRequiredService<IAspireStore>(); 134return app.Services.GetRequiredService<IAspireStore>();
Backchannel\Exec\ExecTestsBase.cs (1)
28var appHostRpcTarget = app.Services.GetRequiredService<AppHostRpcTarget>();
Codespaces\CodespacesUrlRewriterTests.cs (1)
34var collector = app.Services.GetFakeLogCollector();
Dashboard\DashboardResourceTests.cs (17)
46var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 70var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 103var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 175var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 213var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 250var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 284var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 320var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 329var config = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(dashboard, DistributedApplicationOperation.Run, app.Services).DefaultTimeout(); 364var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 368var config = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(dashboard, DistributedApplicationOperation.Run, app.Services).DefaultTimeout(); 389var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 405var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 456var resourceLoggerService = app.Services.GetRequiredService<ResourceLoggerService>(); 470var model = app.Services.GetRequiredService<DistributedApplicationModel>(); 471var resourceNotificationService = app.Services.GetRequiredService<ResourceNotificationService>(); 522var model = app.Services.GetRequiredService<DistributedApplicationModel>();
Dcp\DcpCliArgsTests.cs (1)
54var dcpOptions = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value;
Dcp\DcpExecutorTests.cs (29)
36var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 61var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 145var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 188var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 237var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 269var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 301var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 334var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 371var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 391var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 425var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 459var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 523var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 545var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 581var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 679var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 785var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 830var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 867var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 902var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 962var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 983var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 1019var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 1056var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 1093var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 1123var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 1160var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 1182var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 1217var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>();
DistributedApplicationBuilderTests.cs (10)
39Assert.NotNull(app.Services.GetRequiredKeyedService<IDistributedApplicationPublisher>("manifest")); 41var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 44var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>(); 51var options = app.Services.GetRequiredService<IOptions<PublishingOptions>>(); 63var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 74var publishOptions = app.Services.GetRequiredService<IOptions<PublishingOptions>>(); 87var publishOptions = app.Services.GetRequiredService<IOptions<PublishingOptions>>(); 99var config = app.Services.GetRequiredService<IConfiguration>(); 109var config = app.Services.GetRequiredService<IConfiguration>(); 122var config = app.Services.GetRequiredService<IConfiguration>();
DistributedApplicationModelExtensionsTests.cs (1)
26var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
DistributedApplicationTests.cs (44)
127var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 128var orchestrator = app.Services.GetRequiredService<ApplicationOrchestrator>(); 129var logger = app.Services.GetRequiredService<ILogger<DistributedApplicationTests>>(); 170var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 171var orchestrator = app.Services.GetRequiredService<ApplicationOrchestrator>(); 172var logger = app.Services.GetRequiredService<ILogger<DistributedApplicationTests>>(); 245var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 246var orchestrator = app.Services.GetRequiredService<ApplicationOrchestrator>(); 247var logger = app.Services.GetRequiredService<ILogger<DistributedApplicationTests>>(); 322var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 323var orchestrator = app.Services.GetRequiredService<ApplicationOrchestrator>(); 324var logger = app.Services.GetRequiredService<ILogger<DistributedApplicationTests>>(); 470var logger = app.Services.GetRequiredService<ILogger<DistributedApplicationTests>>(); 528var s = app.Services.GetRequiredService<IKubernetesService>(); 581var s = app.Services.GetRequiredService<IKubernetesService>(); 617var events = app.Services.GetRequiredService<IDistributedApplicationEventing>(); 624var kubernetes = app.Services.GetRequiredService<IKubernetesService>(); 625var orchestrator = app.Services.GetRequiredService<ApplicationOrchestrator>(); 626var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 667var kubernetes = app.Services.GetRequiredService<IKubernetesService>(); 668var orchestrator = app.Services.GetRequiredService<ApplicationOrchestrator>(); 669var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 711var kubernetes = app.Services.GetRequiredService<IKubernetesService>(); 715var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 766var kubernetes = app.Services.GetRequiredService<IKubernetesService>(); 770var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 806var kubernetes = app.Services.GetRequiredService<IKubernetesService>(); 810var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 841var s = app.Services.GetRequiredService<IKubernetesService>(); 843var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 870var s = app.Services.GetRequiredService<IKubernetesService>(); 872var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 899var s = app.Services.GetRequiredService<IKubernetesService>(); 901var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 929var s = app.Services.GetRequiredService<IKubernetesService>(); 931var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 955var s = app.Services.GetRequiredService<IKubernetesService>(); 1015var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 1034var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 1176var s = app.Services.GetRequiredService<IKubernetesService>(); 1226var s = app.Services.GetRequiredService<IKubernetesService>(); 1289var s = app.Services.GetRequiredService<IKubernetesService>(); 1314var s = app.Services.GetRequiredService<IKubernetesService>(); 1315var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
168var eventing = app.Services.GetRequiredService<IDistributedApplicationEventing>();
ExternalServiceTests.cs (4)
167var config = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(project.Resource, DistributedApplicationOperation.Publish, app.Services).DefaultTimeout(); 392var healthCheckService = app.Services.GetService<HealthCheckService>(); 413var healthCheckService = app.Services.GetService<HealthCheckService>(); 430var healthCheckService = app.Services.GetRequiredService<HealthCheckService>();
Health\ResourceHealthCheckServiceTests.cs (6)
158var healthService = app.Services.GetRequiredService<ResourceHealthCheckService>(); 221var logger = app.Services.GetRequiredService<ILogger<ResourceHealthCheckServiceTests>>(); 222var rhcs = app.Services.GetRequiredService<ResourceHealthCheckService>(); 261var logger = app.Services.GetRequiredService<ILogger<ResourceHealthCheckServiceTests>>(); 262var rhcs = app.Services.GetRequiredService<ResourceHealthCheckService>(); 482var rhcs = app.Services.GetRequiredService<ResourceHealthCheckService>();
HealthCheckTests.cs (2)
101var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 139var collector = app.Services.GetFakeLogCollector();
Helpers\JsonDocumentManifestPublisher.cs (1)
44var publisher = testProgram.App?.Services.GetRequiredKeyedService<IDistributedApplicationPublisher>("manifest") as JsonDocumentManifestPublisher;
KestrelConfigTests.cs (1)
359var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
ManifestGenerationTests.cs (1)
120var publisher = program.Services.GetManifestPublisher();
Orchestrator\ApplicationOrchestratorTests.cs (10)
27var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 74var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 119var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 169var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 236var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 288var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 340var e = Assert.Throws<InvalidOperationException>(() => app.Services.GetService<ApplicationOrchestrator>()); 358var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 402var distributedAppModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 431await applicationEventing.PublishAsync(new ConnectionStringAvailableEvent(resource.Resource, app.Services), CancellationToken.None);
Orchestrator\RelationshipEvaluatorTests.cs (1)
28var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
ProjectResourceTests.cs (15)
71var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 185var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 212var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 230var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 246var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 296var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 316var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 359var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 381var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 406var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 436var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 455var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 479var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 529var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 624var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Publishing\ResourceContainerImageBuilderTests.cs (22)
35var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 39var collector = app.Services.GetFakeLogCollector(); 65var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 69var collector = app.Services.GetFakeLogCollector(); 103var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 107var collector = app.Services.GetFakeLogCollector(); 141var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 145var collector = app.Services.GetFakeLogCollector(); 175var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 179var collector = app.Services.GetFakeLogCollector(); 212var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 216var collector = app.Services.GetFakeLogCollector(); 252var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 256var collector = app.Services.GetFakeLogCollector(); 291var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 295var collector = app.Services.GetFakeLogCollector(); 327var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 331var collector = app.Services.GetFakeLogCollector(); 356var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 362var collector = app.Services.GetFakeLogCollector(); 404var imageBuilder = app.Services.GetRequiredService<IResourceContainerImageBuilder>(); 411var collector = app.Services.GetFakeLogCollector();
PublishingTests.cs (3)
218var publishingOptions = app.Services.GetRequiredService<IOptions<PublishingOptions>>(); 229var publishingOptions = app.Services.GetRequiredService<IOptions<PublishingOptions>>(); 240var publishingOptions = app.Services.GetRequiredService<IOptions<PublishingOptions>>();
Schema\SchemaTests.cs (1)
226var publisher = program.Services.GetManifestPublisher();
Utils\LoggerNotificationExtensions.cs (4)
35var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 78var hostApplicationLifetime = app.Services.GetRequiredService<IHostApplicationLifetime>(); 124var resourceLoggerService = app.Services.GetRequiredService<ResourceLoggerService>(); 125var logger = app.Services.GetRequiredService<ILoggerFactory>().CreateLogger(nameof(LoggerNotificationExtensions));
WaitForTests.cs (1)
574var collector = app.Services.GetFakeLogCollector();
WithEndpointTests.cs (1)
209var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
WithEnvironmentTests.cs (1)
29var serviceProvider = app.Services.GetRequiredService<IServiceProvider>();
WithHttpCommandTests.cs (1)
30var httpClientFactory = app.Services.GetService<IHttpClientFactory>();
WithUrlsTests.cs (4)
326var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 362var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 444var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 570var rns = app.Services.GetRequiredService<ResourceNotificationService>();
Aspire.Hosting.Valkey.Tests (6)
AddValkeyTests.cs (6)
22var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 50var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 79var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 98var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 115var appModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 333var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Aspire.Playground.Tests (11)
AppHostTests.cs (1)
68var applicationModel = app.Services.GetRequiredService<DistributedApplicationModel>();
Infrastructure\DistributedApplicationExtensions.cs (6)
104var applicationModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 114var environment = app.Services.GetRequiredService<IHostEnvironment>(); 115var logCollector = app.Services.GetFakeLogCollector(); 132var environment = app.Services.GetRequiredService<IHostEnvironment>(); 133var applicationModel = app.Services.GetRequiredService<DistributedApplicationModel>(); 212var logger = app.Services.GetRequiredService<ILoggerFactory>().CreateLogger(nameof(TryApplyEfMigrationsAsync));
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (4)
35var rns = app.Services.GetRequiredService<ResourceNotificationService>(); 78var hostApplicationLifetime = app.Services.GetRequiredService<IHostApplicationLifetime>(); 124var resourceLoggerService = app.Services.GetRequiredService<ResourceLoggerService>(); 125var logger = app.Services.GetRequiredService<ILoggerFactory>().CreateLogger(nameof(LoggerNotificationExtensions));
TestingAppHost1.AppHost (1)
Program.cs (1)
59var notifications = app.Services.GetRequiredService<ResourceNotificationService>();