6 implementations of IDistributedApplicationLifecycleHook
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
18internal sealed class DaprDistributedApplicationLifecycleHook : IDistributedApplicationLifecycleHook, IDisposable
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (1)
828private 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)
152private sealed class EndPointWriterHook : IDistributedApplicationLifecycleHook
32 references to IDistributedApplicationLifecycleHook
Aspire.Hosting (21)
ApplicationModel\AfterEndpointsAllocatedEvent.cs (2)
15/// Subscribing to this event is analogous to implementing the <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.AfterEndpointsAllocatedAsync(DistributedApplicationModel, CancellationToken)"/> 18/// in <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.AfterEndpointsAllocatedAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel, CancellationToken)"/>.
ApplicationModel\AfterResourcesCreatedEvent.cs (2)
15/// Subscribing to this event is analogous to implementing the <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.AfterResourcesCreatedAsync(DistributedApplicationModel, CancellationToken)"/> 18/// in <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.AfterResourcesCreatedAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel, CancellationToken)"/>.
ApplicationModel\BeforeStartEvent.cs (2)
15/// Subscribing to this event is analogous to implementing the <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.BeforeStartAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel, CancellationToken)"/> 18/// in <see cref="Aspire.Hosting.Lifecycle.IDistributedApplicationLifecycleHook.BeforeStartAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel, CancellationToken)"/>.
Dashboard\DashboardLifecycleHook.cs (1)
29ILoggerFactory loggerFactory) : IDistributedApplicationLifecycleHook, IAsyncDisposable
Dcp\ApplicationExecutor.cs (2)
67IEnumerable<IDistributedApplicationLifecycleHook> lifecycleHooks, 93private 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)
132private sealed class WriteParameterLogsHook(ResourceLoggerService loggerService, string resourceName, string message) : IDistributedApplicationLifecycleHook
Aspire.Hosting.AWS (1)
AWSLifecycleHook.cs (1)
17ResourceLoggerService loggerService) : IDistributedApplicationLifecycleHook
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\AzureProvisioner.cs (1)
38) : IDistributedApplicationLifecycleHook
Aspire.Hosting.Azure.Tests (1)
AzureBicepResourceTests.cs (1)
84var hooks = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
Aspire.Hosting.Tests (6)
AddParameterTests.cs (1)
92Assert.Contains(app.Services.GetServices<IDistributedApplicationLifecycleHook>(), hook => hook.GetType().Name == "WriteParameterLogsHook");
Dcp\ApplicationExecutorTests.cs (1)
967Array.Empty<IDistributedApplicationLifecycleHook>(),
DistributedApplicationBuilderTests.cs (1)
43var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
DistributedApplicationTests.cs (3)
139var lifecycleHookDescriptors = testProgram.AppBuilder.Services.Where(sd => sd.ServiceType == typeof(IDistributedApplicationLifecycleHook)); 168private sealed class CheckAllocatedEndpointsLifecycleHook(TaskCompletionSource<DistributedApplicationModel> tcs) : IDistributedApplicationLifecycleHook 819var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();
CustomResources.AppHost (1)
TestResource.cs (1)
30internal sealed class TestResourceLifecycleHook(ResourceNotificationService notificationService, ResourceLoggerService loggerService) : IDistributedApplicationLifecycleHook, IAsyncDisposable
Stress.AppHost (1)
TestResource.cs (1)
30internal sealed class TestResourceLifecycleHook(ResourceNotificationService notificationService, ResourceLoggerService loggerService) : IDistributedApplicationLifecycleHook, IAsyncDisposable