21 references to ContainerLifetime
Aspire.Hosting (15)
ApplicationModel\ContainerLifetimeAnnotation.cs (1)
42
public required
ContainerLifetime
Lifetime { get; set; }
ApplicationModel\ResourceExtensions.cs (3)
1147
ContainerLifetime
.Session => Lifetime.Session,
1148
ContainerLifetime
.Persistent => Lifetime.Persistent,
1149
_ => throw new InvalidOperationException($"Unknown container lifetime '{Enum.GetName(typeof(
ContainerLifetime
), containerLifetimeAnnotation.Lifetime)}'.")
ContainerResourceBuilderExtensions.cs (8)
562
/// <param name="lifetime">The lifetime behavior of the container resource. The default behavior is <see cref="
ContainerLifetime
.Session"/>.</param>
571
/// Marking a container resource to have a <see cref="
ContainerLifetime
.Persistent"/> lifetime.
583
public static IResourceBuilder<T> WithLifetime<T>(this IResourceBuilder<T> builder,
ContainerLifetime
lifetime) where T : ContainerResource
592
ContainerLifetime
.Session => PersistenceMode.Session,
593
ContainerLifetime
.Persistent => PersistenceMode.Persistent,
1099
/// Combining this with <see cref="
ContainerLifetime
.Persistent"/> will allow Aspire to re-use an existing container that was not
1360
/// For containers with a <see cref="
ContainerLifetime
.Persistent"/> lifetime, changing the contents of create file entries will result in the container being recreated.
1423
/// For containers with a <see cref="
ContainerLifetime
.Persistent"/> lifetime, changing the contents of create file entries will result in the container being recreated.
Dcp\ResourceSnapshotBuilder.cs (3)
92
ContainerLifetime
GetContainerLifetime()
94
return (container.Spec.Persistent ?? false) ?
ContainerLifetime
.Persistent :
ContainerLifetime
.Session;
Aspire.Hosting.Azure.Tests (1)
AzureServiceBusExtensionsTests.cs (1)
957
builder.AddAzureServiceBus("servicebus").RunAsEmulator(configure => configure.WithLifetime(
ContainerLifetime
.Persistent));
Aspire.Hosting.Redis.Tests (1)
AddRedisTests.cs (1)
969
.WithLifetime(
ContainerLifetime
.Persistent)
Aspire.Hosting.Tests (2)
Dcp\DcpExecutorTests.cs (1)
1505
.WithAnnotation(new ContainerLifetimeAnnotation { Lifetime =
ContainerLifetime
.Persistent })
Dcp\ResourceSnapshotBuilderTests.cs (1)
118
Lifetime =
ContainerLifetime
.Persistent
Aspire.Hosting.TestUtilities (2)
Utils\PersistentContainerTestHelpers.cs (2)
131
return GetPropertyValue(evt, ContainerLifetimePropertyName) is
ContainerLifetime
.Persistent &&
137
Assert.Equal(
ContainerLifetime
.Persistent, containerLifetime);