6 implementations of IDistributedApplicationLifecycleHook
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
18
internal sealed class DaprDistributedApplicationLifecycleHook :
IDistributedApplicationLifecycleHook
, IDisposable
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (1)
878
private sealed class KubernetesTestLifecycleHook :
IDistributedApplicationLifecycleHook
Helpers\CallbackLifecycleHook.cs (1)
8
internal sealed class CallbackLifecycleHook :
IDistributedApplicationLifecycleHook
Helpers\DummyLifecycleHook.cs (1)
8
internal sealed class DummyLifecycleHook :
IDistributedApplicationLifecycleHook
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationTestFactory.cs (1)
57
internal sealed class ContainerRegistryHook :
IDistributedApplicationLifecycleHook
TestProject.AppHost (1)
TestProgram.cs (1)
142
private 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)
34
CodespacesUrlRewriter codespaceUrlRewriter) :
IDistributedApplicationLifecycleHook
, IAsyncDisposable
Dcp\ApplicationExecutor.cs (2)
73
IEnumerable<
IDistributedApplicationLifecycleHook
> lifecycleHooks,
100
private readonly
IDistributedApplicationLifecycleHook
[] _lifecycleHooks = lifecycleHooks.ToArray();
DistributedApplication.cs (2)
353
var lifecycleHooks = _host.Services.GetServices<
IDistributedApplicationLifecycleHook
>();
356
foreach (
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)
19
public static void AddLifecycleHook<T>(this IServiceCollection services) where T : class,
IDistributedApplicationLifecycleHook
21
services.AddSingleton<
IDistributedApplicationLifecycleHook
, T>();
29
public static void TryAddLifecycleHook<T>(this IServiceCollection services) where T : class,
IDistributedApplicationLifecycleHook
31
services.TryAddEnumerable(ServiceDescriptor.Singleton<
IDistributedApplicationLifecycleHook
, T>());
40
public static void AddLifecycleHook<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class,
IDistributedApplicationLifecycleHook
42
services.AddSingleton<
IDistributedApplicationLifecycleHook
, T>(implementationFactory);
51
public static void TryAddLifecycleHook<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class,
IDistributedApplicationLifecycleHook
53
services.TryAddEnumerable(ServiceDescriptor.Singleton<
IDistributedApplicationLifecycleHook
, T>(implementationFactory));
ParameterResourceBuilderExtensions.cs (1)
199
private 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.
25
DistributedApplicationExecutionContext executionContext) :
IDistributedApplicationLifecycleHook
Aspire.Hosting.Azure.Tests (1)
AzureBicepResourceTests.cs (1)
88
var hooks = app.Services.GetServices<
IDistributedApplicationLifecycleHook
>();
Aspire.Hosting.Tests (6)
AddParameterTests.cs (1)
93
Assert.Contains(app.Services.GetServices<
IDistributedApplicationLifecycleHook
>(), hook => hook.GetType().Name == "WriteParameterLogsHook");
Dcp\ApplicationExecutorTests.cs (1)
1077
Array.Empty<
IDistributedApplicationLifecycleHook
>(),
DistributedApplicationBuilderTests.cs (1)
44
var lifecycles = app.Services.GetServices<
IDistributedApplicationLifecycleHook
>();
DistributedApplicationTests.cs (3)
140
var lifecycleHookDescriptors = testProgram.AppBuilder.Services.Where(sd => sd.ServiceType == typeof(
IDistributedApplicationLifecycleHook
));
169
private sealed class CheckAllocatedEndpointsLifecycleHook(TaskCompletionSource<DistributedApplicationModel> tcs) :
IDistributedApplicationLifecycleHook
869
var lifecycles = app.Services.GetServices<
IDistributedApplicationLifecycleHook
>();
CustomResources.AppHost (1)
TestResource.cs (1)
30
internal sealed class TestResourceLifecycleHook(ResourceNotificationService notificationService, ResourceLoggerService loggerService) :
IDistributedApplicationLifecycleHook
, IAsyncDisposable
HealthChecksSandbox.AppHost (1)
Program.cs (1)
63
internal sealed class TestResourceLifecycleHook(ResourceNotificationService notificationService) :
IDistributedApplicationLifecycleHook
Stress.AppHost (1)
TestResource.cs (1)
49
internal sealed class TestResourceLifecycleHook(ResourceNotificationService notificationService, ResourceLoggerService loggerService) :
IDistributedApplicationLifecycleHook
, IAsyncDisposable