6 implementations of IDistributedApplicationLifecycleHook
Aspire.Hosting (1)
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (1)
12internal sealed class DevcontainerPortForwardingLifecycleHook : IDistributedApplicationLifecycleHook
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (1)
1132private sealed class KubernetesTestLifecycleHook : IDistributedApplicationLifecycleHook
Helpers\CallbackLifecycleHook.cs (1)
8internal sealed class CallbackLifecycleHook : IDistributedApplicationLifecycleHook
Helpers\DummyLifecycleHook.cs (1)
8internal sealed class DummyLifecycleHook : IDistributedApplicationLifecycleHook
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationTestFactory.cs (1)
50internal sealed class ContainerRegistryHook : IDistributedApplicationLifecycleHook
TestProject.AppHost (1)
TestProgram.cs (1)
155private sealed class EndPointWriterHook : IDistributedApplicationLifecycleHook
34 references to IDistributedApplicationLifecycleHook
Aspire.Hosting (22)
ApplicationModel\AfterEndpointsAllocatedEvent.cs (2)
14/// Subscribing to this event is analogous to implementing the <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.AfterEndpointsAllocatedAsync(DistributedApplicationModel, CancellationToken)"/> 17/// in <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.AfterEndpointsAllocatedAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel, CancellationToken)"/>.
ApplicationModel\AfterResourcesCreatedEvent.cs (2)
14/// Subscribing to this event is analogous to implementing the <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.AfterResourcesCreatedAsync(DistributedApplicationModel, CancellationToken)"/> 17/// in <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.AfterResourcesCreatedAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel, CancellationToken)"/>.
ApplicationModel\BeforeStartEvent.cs (2)
14/// Subscribing to this event is analogous to implementing the <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.BeforeStartAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel, CancellationToken)"/> 17/// in <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.BeforeStartAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel, CancellationToken)"/>.
Dashboard\DashboardLifecycleHook.cs (1)
39) : IDistributedApplicationLifecycleHook, IAsyncDisposable
DistributedApplication.cs (2)
406var lifecycleHooks = _host.Services.GetServices<IDistributedApplicationLifecycleHook>(); 409foreach (var lifecycleHook in lifecycleHooks)
IDistributedApplicationBuilder.cs (1)
176/// collection. Not all changes to annotations will be effective depending on what stage of the lifecycle the app host is in. See <see cref="IDistributedApplicationLifecycleHook"/>
Lifecycle\LifecycleHookServiceCollectionExtensions.cs (8)
19public static void AddLifecycleHook<T>(this IServiceCollection services) where T : class, IDistributedApplicationLifecycleHook 21services.AddSingleton<IDistributedApplicationLifecycleHook, T>(); 29public static void TryAddLifecycleHook<T>(this IServiceCollection services) where T : class, IDistributedApplicationLifecycleHook 31services.TryAddEnumerable(ServiceDescriptor.Singleton<IDistributedApplicationLifecycleHook, T>()); 40public static void AddLifecycleHook<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IDistributedApplicationLifecycleHook 42services.AddSingleton<IDistributedApplicationLifecycleHook, T>(implementationFactory); 51public static void TryAddLifecycleHook<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IDistributedApplicationLifecycleHook 53services.TryAddEnumerable(ServiceDescriptor.Singleton<IDistributedApplicationLifecycleHook, T>(implementationFactory));
Orchestrator\ApplicationOrchestrator.cs (4)
21private readonly IDistributedApplicationLifecycleHook[] _lifecycleHooks; 31IEnumerable<IDistributedApplicationLifecycleHook> lifecycleHooks, 96foreach (var lifecycleHook in _lifecycleHooks) 231foreach (var lifecycleHook in _lifecycleHooks)
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\AzureProvisioner.cs (1)
40) : IDistributedApplicationLifecycleHook
Aspire.Hosting.Azure.AppContainers (2)
AzureContainerAppsInfrastructure.cs (2)
20/// Implements the <see cref="IDistributedApplicationLifecycleHook"/> interface to provide lifecycle hooks for distributed applications. 25DistributedApplicationExecutionContext executionContext) : IDistributedApplicationLifecycleHook
Aspire.Hosting.Azure.Tests (1)
AzureBicepResourceTests.cs (1)
88var hooks = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
Aspire.Hosting.Tests (5)
DistributedApplicationBuilderTests.cs (1)
45var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
DistributedApplicationTests.cs (3)
305var lifecycleHookDescriptors = testProgram.AppBuilder.Services.Where(sd => sd.ServiceType == typeof(IDistributedApplicationLifecycleHook)); 334private sealed class CheckAllocatedEndpointsLifecycleHook(TaskCompletionSource<DistributedApplicationModel> tcs) : IDistributedApplicationLifecycleHook 1114var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
Orchestrator\ApplicationOrchestratorTests.cs (1)
265Array.Empty<IDistributedApplicationLifecycleHook>(),
CustomResources.AppHost (1)
TestResource.cs (1)
30internal sealed class TestResourceLifecycleHook(ResourceNotificationService notificationService, ResourceLoggerService loggerService) : IDistributedApplicationLifecycleHook, IAsyncDisposable
HealthChecksSandbox.AppHost (1)
Program.cs (1)
63internal sealed class TestResourceLifecycleHook(ResourceNotificationService notificationService) : IDistributedApplicationLifecycleHook
Stress.AppHost (1)
TestResource.cs (1)
49internal sealed class TestResourceLifecycleHook(ResourceNotificationService notificationService, ResourceLoggerService loggerService) : IDistributedApplicationLifecycleHook, IAsyncDisposable