20 references to ContainerLifetime
Aspire.Hosting (14)
ApplicationModel\ResourceExtensions.cs (5)
321
/// Defaults to <see cref="
ContainerLifetime
.Session"/> if no <see cref="ContainerLifetimeAnnotation"/> is found.
325
/// The <see cref="
ContainerLifetime
"/> from the <see cref="ContainerLifetimeAnnotation"/> for the resource (if the annotation exists).
326
/// Defaults to <see cref="
ContainerLifetime
.Session"/> if the annotation is not set.
328
internal static
ContainerLifetime
GetContainerLifetimeType(this IResource resource)
335
return
ContainerLifetime
.Session;
ContainerResourceBuilderExtensions.cs (4)
271
/// <param name="lifetime">The lifetime behavior of the container resource. The defaults behavior is <see cref="
ContainerLifetime
.Session"/>.</param>
274
/// Marking a container resource to have a <see cref="
ContainerLifetime
.Persistent"/> lifetime.
284
public static IResourceBuilder<T> WithLifetime<T>(this IResourceBuilder<T> builder,
ContainerLifetime
lifetime) where T : ContainerResource
421
/// Combining this with <see cref="
ContainerLifetime
.Persistent"/> will allow Aspire to re-use an existing container that was not
Dcp\ApplicationExecutor.cs (4)
665
ContainerLifetime
GetContainerLifetime()
667
return (container.Spec.Persistent ?? false) ?
ContainerLifetime
.Persistent :
ContainerLifetime
.Session;
1471
if (container.GetContainerLifetimeType() ==
ContainerLifetime
.Persistent)
Dcp\DcpNameGenerator.cs (1)
67
ContainerLifetime
.Session => GetRandomNameSuffix(),
Aspire.Hosting.Azure.Tests (1)
AzureResourceOptionsTests.cs (1)
38
.RunAsContainer(x => x.WithLifetime(
ContainerLifetime
.Persistent))
Aspire.Hosting.Redis.Tests (2)
RedisFunctionalTests.cs (2)
145
c.WithLifetime(
ContainerLifetime
.Persistent);
185
c.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))