4 implementations of IDistributedApplicationLifecycleHook
Aspire.Hosting.Tests (4)
DistributedApplicationTests.cs (2)
465private sealed class CheckAllocatedEndpointsLifecycleHook(TaskCompletionSource<DistributedApplicationModel> tcs) : IDistributedApplicationLifecycleHook 1522private sealed class KubernetesTestLifecycleHook : IDistributedApplicationLifecycleHook
Helpers\CallbackLifecycleHook.cs (1)
9internal sealed class CallbackLifecycleHook : IDistributedApplicationLifecycleHook
Helpers\DummyLifecycleHook.cs (1)
9internal sealed class DummyLifecycleHook : IDistributedApplicationLifecycleHook
23 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)"/>.
DistributedApplication.cs (2)
493var lifecycleHooks = _host.Services.GetServices<IDistributedApplicationLifecycleHook>(); 497foreach (var lifecycleHook in lifecycleHooks)
IDistributedApplicationBuilder.cs (1)
190/// 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)
20public static void AddLifecycleHook<T>(this IServiceCollection services) where T : class, IDistributedApplicationLifecycleHook 22services.AddSingleton<IDistributedApplicationLifecycleHook, T>(); 31public static void TryAddLifecycleHook<T>(this IServiceCollection services) where T : class, IDistributedApplicationLifecycleHook 33services.TryAddEnumerable(ServiceDescriptor.Singleton<IDistributedApplicationLifecycleHook, T>()); 43public static void AddLifecycleHook<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IDistributedApplicationLifecycleHook 45services.AddSingleton<IDistributedApplicationLifecycleHook, T>(implementationFactory); 55public static void TryAddLifecycleHook<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IDistributedApplicationLifecycleHook 57services.TryAddEnumerable(ServiceDescriptor.Singleton<IDistributedApplicationLifecycleHook, T>(implementationFactory));
Orchestrator\ApplicationOrchestrator.cs (4)
23private readonly IDistributedApplicationLifecycleHook[] _lifecycleHooks; 37IEnumerable<IDistributedApplicationLifecycleHook> lifecycleHooks, 124foreach (var lifecycleHook in _lifecycleHooks) 368foreach (var lifecycleHook in _lifecycleHooks)
Aspire.Hosting.Tests (2)
DistributedApplicationTests.cs (2)
433var lifecycleHookDescriptors = testProgram.AppBuilder.Services.Where(sd => sd.ServiceType == typeof(IDistributedApplicationLifecycleHook)); 1496var lifecycles = app.Services.GetServices<IDistributedApplicationLifecycleHook>();