Share via


ResourceBuilderExtensions.WithArgs Method

Definition

Overloads

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

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

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

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

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

Adds arguments to be passed to a resource that supports arguments when it is launched.

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

Adds arguments to be passed to a resource that supports arguments when it is launched.

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

Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs

Adds a callback to be executed with a list of command-line arguments when a 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 for a resource implementing IResourceWithArgs.

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
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs

Adds an asynchronous callback to be executed with a list of command-line arguments when a 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 for a resource implementing IResourceWithArgs.

callback
Func<CommandLineArgsCallbackContext,Task>

An asynchronous 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>, Object[])

Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs

Adds arguments to be passed to a resource that supports arguments when it is launched.

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 for a resource implementing IResourceWithArgs.

args
Object[]

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

Returns

The IResourceBuilder<T>.

Applies to

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

Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs
Source:
ResourceBuilderExtensions.cs

Adds arguments to be passed to a resource that supports arguments when it is launched.

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 for a resource implementing IResourceWithArgs.

args
String[]

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

Returns

The IResourceBuilder<T>.

Applies to