46 references to ContainerLifetime
Aspire.Hosting (18)
ApplicationModel\ContainerLifetimeAnnotation.cs (1)
42public required ContainerLifetime Lifetime { get; set; }
ApplicationModel\ResourceExtensions.cs (5)
1002/// Defaults to <see cref="ContainerLifetime.Session"/> if no <see cref="ContainerLifetimeAnnotation"/> is found. 1006/// The <see cref="ContainerLifetime"/> from the <see cref="ContainerLifetimeAnnotation"/> for the resource (if the annotation exists). 1007/// Defaults to <see cref="ContainerLifetime.Session"/> if the annotation is not set. 1009internal static ContainerLifetime GetContainerLifetimeType(this IResource resource) 1016return ContainerLifetime.Session;
ContainerResourceBuilderExtensions.cs (6)
476/// <param name="lifetime">The lifetime behavior of the container resource. The defaults behavior is <see cref="ContainerLifetime.Session"/>.</param> 480/// Marking a container resource to have a <see cref="ContainerLifetime.Persistent"/> lifetime. 491public static IResourceBuilder<T> WithLifetime<T>(this IResourceBuilder<T> builder, ContainerLifetime lifetime) where T : ContainerResource 959/// Combining this with <see cref="ContainerLifetime.Persistent"/> will allow Aspire to re-use an existing container that was not 1156/// For containers with a <see cref="ContainerLifetime.Persistent"/> lifetime, changing the contents of create file entries will result in the container being recreated. 1217/// For containers with a <see cref="ContainerLifetime.Persistent"/> lifetime, changing the contents of create file entries will result in the container being recreated.
Dcp\DcpExecutor.cs (2)
1051if (containerResources.Any(cr => cr.GetContainerLifetimeType() == ContainerLifetime.Persistent)) 1782if (container.GetContainerLifetimeType() == ContainerLifetime.Persistent)
Dcp\DcpNameGenerator.cs (1)
67ContainerLifetime.Session => GetRandomNameSuffix(),
Dcp\ResourceSnapshotBuilder.cs (3)
88ContainerLifetime GetContainerLifetime() 90return (container.Spec.Persistent ?? false) ? ContainerLifetime.Persistent : ContainerLifetime.Session;
Aspire.Hosting.Azure.EventHubs (2)
AzureEventHubsExtensions.cs (2)
258var lifetime = ContainerLifetime.Session;
Aspire.Hosting.Azure.Kusto.Tests (2)
AddAzureKustoTests.cs (2)
306containerBuilder.WithLifetime(ContainerLifetime.Persistent); 312Assert.Equal(ContainerLifetime.Persistent, lifetimeAnnotation.Lifetime);
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (2)
407var lifetime = ContainerLifetime.Session;
Aspire.Hosting.Azure.Tests (7)
AzureEventHubsExtensionsTests.cs (3)
510var lifetime = isPersistent ? ContainerLifetime.Persistent : ContainerLifetime.Session;
AzureResourceOptionsTests.cs (1)
37.RunAsContainer(x => x.WithLifetime(ContainerLifetime.Persistent))
AzureServiceBusExtensionsTests.cs (3)
607var lifetime = isPersistent ? ContainerLifetime.Persistent : ContainerLifetime.Session;
Aspire.Hosting.MySql.Tests (3)
MySqlFunctionalTests.cs (3)
569.AddMySql("resource", password: passwordParameter).WithLifetime(ContainerLifetime.Persistent) 570.WithPhpMyAdmin(c => c.WithLifetime(ContainerLifetime.Persistent)) 576builder.AddMySql("resource2", password: passwordParameter2).WithLifetime(ContainerLifetime.Persistent);
Aspire.Hosting.PostgreSQL.Tests (3)
PostgresFunctionalTests.cs (3)
556.AddPostgres("resource", password: passwordParameter).WithLifetime(ContainerLifetime.Persistent) 557.WithPgWeb(c => c.WithLifetime(ContainerLifetime.Persistent)) 558.WithPgAdmin(c => c.WithLifetime(ContainerLifetime.Persistent))
Aspire.Hosting.Tests (2)
DistributedApplicationTests.cs (2)
320.WithLifetime(ContainerLifetime.Persistent) 1635.WithLifetime(ContainerLifetime.Persistent);
AzureAppService.AppHost (2)
Program.cs (2)
16.RunAsEmulator(c => c.WithLifetime(ContainerLifetime.Persistent)); 27.RunAsEmulator(c => c.WithLifetime(ContainerLifetime.Persistent));
AzureContainerApps.AppHost (3)
Program.cs (3)
21.WithLifetime(ContainerLifetime.Persistent) 27.RunAsEmulator(c => c.WithLifetime(ContainerLifetime.Persistent)); 33.RunAsEmulator(c => c.WithLifetime(ContainerLifetime.Persistent));
ServiceBus.AppHost (1)
Program.cs (1)
37}).WithLifetime(ContainerLifetime.Persistent));
TestShop.AppHost (1)
AppHost.cs (1)
72.WithLifetime(ContainerLifetime.Persistent)