IResource.withCommand

Method
📦 Aspire.Hosting v17.0.0
interface IResource {
// ... omitted for brevity
withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResource;
}

Signature

methodwithCommandbuilder
Adds a resource command
withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResource
namestringThe name of the command. The name uniquely identifies the command.
displayNamestringThe display name visible in UI.
executeCommand(arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>A callback that is executed when the command is executed. The callback is run inside the Aspire host. The callback result is used to indicate success or failure in the UI.
commandOptionsCommandOptionsoptionalOptional configuration for the command.
IResource

Defined on

This method is defined on the following type: