Freigeben über


ResourceBuilderExtensions.WithArgs Method

Definition

Overloads

WithArgs<T>(IResourceBuilder<T>, Object[])

Adds the arguments to be passed to a container resource when the container is started.

WithArgs<T>(IResourceBuilder<T>, String[])

Adds the arguments to be passed to a container resource when the container is started.

WithArgs<T>(IResourceBuilder<T>, Action<CommandLineArgsCallbackContext>)

Adds a callback to be executed with a list of command-line arguments when a container resource is started.

WithArgs<T>(IResourceBuilder<T>, Func<CommandLineArgsCallbackContext,Task>)

Adds a callback to be executed with a list of command-line arguments when a container resource is started.

WithArgs<T>(IResourceBuilder<T>, Object[])

Source:
ResourceBuilderExtensions.cs

Adds the arguments to be passed to a container resource when the container is started.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithArgs<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, params object[] args) where T : Aspire.Hosting.ApplicationModel.IResourceWithArgs;
static member WithArgs : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> * obj[] -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)
<Extension()>
Public Function WithArgs(Of T As IResourceWithArgs) (builder As IResourceBuilder(Of T), ParamArray args As Object()) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

args
Object[]

The arguments to be passed to the container when it is started.

Returns

The IResourceBuilder<T>.

Applies to

WithArgs<T>(IResourceBuilder<T>, String[])

Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs

Adds the arguments to be passed to a container resource when the container is started.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithArgs<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, params string[] args) where T : Aspire.Hosting.ApplicationModel.IResourceWithArgs;
static member WithArgs : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> * string[] -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)
<Extension()>
Public Function WithArgs(Of T As IResourceWithArgs) (builder As IResourceBuilder(Of T), ParamArray args As String()) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

args
String[]

The arguments to be passed to the container when it is started.

Returns

The IResourceBuilder<T>.

Applies to

WithArgs<T>(IResourceBuilder<T>, Action<CommandLineArgsCallbackContext>)

Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs

Adds a callback to be executed with a list of command-line arguments when a container resource is started.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithArgs<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Action<Aspire.Hosting.ApplicationModel.CommandLineArgsCallbackContext> callback) where T : Aspire.Hosting.ApplicationModel.IResourceWithArgs;
static member WithArgs : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> * Action<Aspire.Hosting.ApplicationModel.CommandLineArgsCallbackContext> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)
<Extension()>
Public Function WithArgs(Of T As IResourceWithArgs) (builder As IResourceBuilder(Of T), callback As Action(Of CommandLineArgsCallbackContext)) As IResourceBuilder(Of T)

Type Parameters

T

Parameters

builder
IResourceBuilder<T>

The resource builder.

callback
Action<CommandLineArgsCallbackContext>

A callback that allows for deferred execution for computing arguments. This runs after resources have been allocated by the orchestrator and allows access to other resources to resolve computed data, e.g. connection strings, ports.

Returns

The IResourceBuilder<T>.

Applies to

WithArgs<T>(IResourceBuilder<T>, Func<CommandLineArgsCallbackContext,Task>)

Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs

Adds a callback to be executed with a list of command-line arguments when a container resource is started.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithArgs<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Func<Aspire.Hosting.ApplicationModel.CommandLineArgsCallbackContext,System.Threading.Tasks.Task> callback) where T : Aspire.Hosting.ApplicationModel.IResourceWithArgs;
static member WithArgs : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> * Func<Aspire.Hosting.ApplicationModel.CommandLineArgsCallbackContext, System.Threading.Tasks.Task> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithArgs)
<Extension()>
Public Function WithArgs(Of T As IResourceWithArgs) (builder As IResourceBuilder(Of T), callback As Func(Of CommandLineArgsCallbackContext, Task)) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

callback
Func<CommandLineArgsCallbackContext,Task>

A callback that allows for deferred execution for computing arguments. This runs after resources have been allocated by the orchestrator and allows access to other resources to resolve computed data, e.g. connection strings, ports.

Returns

The IResourceBuilder<T>.

Applies to