Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ContainerResource.WithLifetime

Method
📦 Aspire.Hosting v17.0.0
type ContainerResource interface {
// ... omitted for brevity
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().

Defined on

This method is defined on the following type: