38 references to ContainerLifetime
Aspire.Hosting (14)
ApplicationModel\ResourceExtensions.cs (5)
542/// Defaults to <see cref="ContainerLifetime.Session"/> if no <see cref="ContainerLifetimeAnnotation"/> is found. 546/// The <see cref="ContainerLifetime"/> from the <see cref="ContainerLifetimeAnnotation"/> for the resource (if the annotation exists). 547/// Defaults to <see cref="ContainerLifetime.Session"/> if the annotation is not set. 549internal static ContainerLifetime GetContainerLifetimeType(this IResource resource) 556return ContainerLifetime.Session;
ContainerResourceBuilderExtensions.cs (4)
385/// <param name="lifetime">The lifetime behavior of the container resource. The defaults behavior is <see cref="ContainerLifetime.Session"/>.</param> 388/// Marking a container resource to have a <see cref="ContainerLifetime.Persistent"/> lifetime. 398public static IResourceBuilder<T> WithLifetime<T>(this IResourceBuilder<T> builder, ContainerLifetime lifetime) where T : ContainerResource 541/// Combining this with <see cref="ContainerLifetime.Persistent"/> will allow Aspire to re-use an existing container that was not
Dcp\DcpExecutor.cs (1)
1081if (container.GetContainerLifetimeType() == ContainerLifetime.Persistent)
Dcp\DcpNameGenerator.cs (1)
67ContainerLifetime.Session => GetRandomNameSuffix(),
Dcp\ResourceSnapshotBuilder.cs (3)
83ContainerLifetime GetContainerLifetime() 85return (container.Spec.Persistent ?? false) ? ContainerLifetime.Persistent : ContainerLifetime.Session;
Aspire.Hosting.Azure.EventHubs (2)
AzureEventHubsExtensions.cs (2)
230var lifetime = ContainerLifetime.Session;
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (2)
382var lifetime = ContainerLifetime.Session;
Aspire.Hosting.Azure.Tests (7)
AzureEventHubsExtensionsTests.cs (3)
538var lifetime = isPersistent ? ContainerLifetime.Persistent : ContainerLifetime.Session;
AzureResourceOptionsTests.cs (1)
38.RunAsContainer(x => x.WithLifetime(ContainerLifetime.Persistent))
AzureServiceBusExtensionsTests.cs (3)
719var lifetime = isPersistent ? ContainerLifetime.Persistent : ContainerLifetime.Session;
Aspire.Hosting.MySql.Tests (3)
MySqlFunctionalTests.cs (3)
485.AddMySql("resource", password: passwordParameter).WithLifetime(ContainerLifetime.Persistent) 486.WithPhpMyAdmin(c => c.WithLifetime(ContainerLifetime.Persistent)) 492builder.AddMySql("resource2", password: passwordParameter2).WithLifetime(ContainerLifetime.Persistent);
Aspire.Hosting.PostgreSQL.Tests (3)
PostgresFunctionalTests.cs (3)
472.AddPostgres("resource", password: passwordParameter).WithLifetime(ContainerLifetime.Persistent) 473.WithPgWeb(c => c.WithLifetime(ContainerLifetime.Persistent)) 474.WithPgAdmin(c => c.WithLifetime(ContainerLifetime.Persistent))
Aspire.Hosting.Redis.Tests (2)
RedisFunctionalTests.cs (2)
146c.WithLifetime(ContainerLifetime.Persistent); 186c.WithLifetime(ContainerLifetime.Persistent);
AzureContainerApps.AppHost (3)
Program.cs (3)
16.WithLifetime(ContainerLifetime.Persistent) 21.RunAsEmulator(c => c.WithLifetime(ContainerLifetime.Persistent)); 26.RunAsEmulator(c => c.WithLifetime(ContainerLifetime.Persistent))
ServiceBus.AppHost (1)
Program.cs (1)
37}).WithLifetime(ContainerLifetime.Persistent));
TestShop.AppHost (1)
Program.cs (1)
31.WithLifetime(ContainerLifetime.Persistent)