Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithLifetime

Method
📦 Aspire.Hosting v17.0.0
func (ContainerResource) WithLifetime(lifetime ContainerLifetime) ContainerResource

Signature

methodWithLifetimebuilder
Sets the lifetime behavior of the container resource.
WithLifetime(lifetime ContainerLifetime) ContainerResource
lifetimeContainerLifetimeThe lifetime behavior of the container resource. The default behavior is Session.
ContainerResource

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: