7 implementations of IDistributedApplicationLifecycleHook
Aspire.Hosting (1)
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (1)
12internal sealed class DevcontainerPortForwardingLifecycleHook : IDistributedApplicationLifecycleHook
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
18internal sealed class DaprDistributedApplicationLifecycleHook : IDistributedApplicationLifecycleHook, IDisposable
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (1)
878private 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)
57internal sealed class ContainerRegistryHook : IDistributedApplicationLifecycleHook
TestProject.AppHost (1)
TestProgram.cs (1)
142private sealed class EndPointWriterHook : IDistributedApplicationLifecycleHook
34 references to IDistributedApplicationLifecycleHook
Aspire.Hosting (21)
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
Dcp\ApplicationExecutor.cs (2)
73IEnumerable<IDistributedApplicationLifecycleHook> lifecycleHooks, 100private readonly IDistributedApplicationLifecycleHook[] _lifecycleHooks = lifecycleHooks.ToArray();
DistributedApplication.cs (2)
353var lifecycleHooks = _host.Services.GetServices<IDistributedApplicationLifecycleHook>(); 356foreach (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));
ParameterResourceBuilderExtensions.cs (1)
199private sealed class WriteParameterLogsHook(ResourceLoggerService loggerService, string resourceName, string message) : IDistributedApplicationLifecycleHook
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 (6)
AddParameterTests.cs (1)
93Assert.Contains(app.Services.GetServices<IDistributedApplicationLifecycleHook>(), hook => hook.GetType().Name == "WriteParameterLogsHook");
Dcp\ApplicationExecutorTests.cs (1)
1077Array.Empty<IDistributedApplicationLifecycleHook>(),
DistributedApplicationBuilderTests.cs (1)
45var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
DistributedApplicationTests.cs (3)
140var lifecycleHookDescriptors = testProgram.AppBuilder.Services.Where(sd => sd.ServiceType == typeof(IDistributedApplicationLifecycleHook)); 169private sealed class CheckAllocatedEndpointsLifecycleHook(TaskCompletionSource<DistributedApplicationModel> tcs) : IDistributedApplicationLifecycleHook 869var lifecycles = app.Services.GetServices<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