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