共用方式為


ContainerResourceBuilderExtensions.WithVolume Method

Definition

Overloads

WithVolume<T>(IResourceBuilder<T>, String)

Adds an anonymous volume to a container resource.

WithVolume<T>(IResourceBuilder<T>, String, String, Boolean)

Adds a volume to a container resource.

WithVolume<T>(IResourceBuilder<T>, String)

Source:
ContainerResourceBuilderExtensions.cs
Source:
ContainerResourceBuilderExtensions.cs

Adds an anonymous volume to a container resource.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithVolume<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, string target) where T : Aspire.Hosting.ApplicationModel.ContainerResource;
static member WithVolume : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> * string -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)
<Extension()>
Public Function WithVolume(Of T As ContainerResource) (builder As IResourceBuilder(Of T), target As String) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

target
String

The target path where the volume is mounted in the container.

Returns

The IResourceBuilder<T>.

Applies to

WithVolume<T>(IResourceBuilder<T>, String, String, Boolean)

Source:
ContainerResourceBuilderExtensions.cs
Source:
ContainerResourceBuilderExtensions.cs

Adds a volume to a container resource.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithVolume<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, string name, string target, bool isReadOnly = false) where T : Aspire.Hosting.ApplicationModel.ContainerResource;
static member WithVolume : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> * string * string * bool -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)
<Extension()>
Public Function WithVolume(Of T As ContainerResource) (builder As IResourceBuilder(Of T), name As String, target As String, Optional isReadOnly As Boolean = false) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

name
String

The name of the volume.

target
String

The target path where the volume is mounted in the container.

isReadOnly
Boolean

A flag that indicates if the volume should be mounted as read-only.

Returns

The IResourceBuilder<T>.

Applies to