Condividi tramite


CommandLineBuilderExtensions.AddMiddleware Metodo

Definizione

Overload

AddMiddleware(CommandLineBuilder, Action<InvocationContext>, MiddlewareOrder)

Aggiunge un delegato middleware alla pipeline di chiamata chiamata prima che venga richiamato un gestore di comandi.

AddMiddleware(CommandLineBuilder, InvocationMiddleware, MiddlewareOrder)

Aggiunge un delegato middleware alla pipeline di chiamata chiamata prima che venga richiamato un gestore di comandi.

AddMiddleware(CommandLineBuilder, Action<InvocationContext>, MiddlewareOrder)

Aggiunge un delegato middleware alla pipeline di chiamata chiamata prima che venga richiamato un gestore di comandi.

public static System.CommandLine.Builder.CommandLineBuilder AddMiddleware (this System.CommandLine.Builder.CommandLineBuilder builder, Action<System.CommandLine.Invocation.InvocationContext> onInvoke, System.CommandLine.Invocation.MiddlewareOrder order = System.CommandLine.Invocation.MiddlewareOrder.Default);
static member AddMiddleware : System.CommandLine.Builder.CommandLineBuilder * Action<System.CommandLine.Invocation.InvocationContext> * System.CommandLine.Invocation.MiddlewareOrder -> System.CommandLine.Builder.CommandLineBuilder
<Extension()>
Public Function AddMiddleware (builder As CommandLineBuilder, onInvoke As Action(Of InvocationContext), Optional order As MiddlewareOrder = System.CommandLine.Invocation.MiddlewareOrder.Default) As CommandLineBuilder

Parametri

builder
CommandLineBuilder

Generatore della riga di comando.

onInvoke
Action<InvocationContext>

Delegato che verrà richiamato prima di una chiamata a un gestore di comandi.

order
MiddlewareOrder

Valore che indica l'ordine in cui verrà richiamato il delegato aggiunto rispetto ad altri nella pipeline.

Restituisce

Stessa istanza di CommandLineBuilder.

Si applica a

AddMiddleware(CommandLineBuilder, InvocationMiddleware, MiddlewareOrder)

Aggiunge un delegato middleware alla pipeline di chiamata chiamata prima che venga richiamato un gestore di comandi.

public static System.CommandLine.Builder.CommandLineBuilder AddMiddleware (this System.CommandLine.Builder.CommandLineBuilder builder, System.CommandLine.Invocation.InvocationMiddleware middleware, System.CommandLine.Invocation.MiddlewareOrder order = System.CommandLine.Invocation.MiddlewareOrder.Default);
static member AddMiddleware : System.CommandLine.Builder.CommandLineBuilder * System.CommandLine.Invocation.InvocationMiddleware * System.CommandLine.Invocation.MiddlewareOrder -> System.CommandLine.Builder.CommandLineBuilder
<Extension()>
Public Function AddMiddleware (builder As CommandLineBuilder, middleware As InvocationMiddleware, Optional order As MiddlewareOrder = System.CommandLine.Invocation.MiddlewareOrder.Default) As CommandLineBuilder

Parametri

builder
CommandLineBuilder

Generatore della riga di comando.

middleware
InvocationMiddleware

Delegato che verrà richiamato prima di una chiamata a un gestore di comandi.

order
MiddlewareOrder

Valore che indica l'ordine in cui verrà richiamato il delegato aggiunto rispetto ad altri nella pipeline.

Restituisce

Stessa istanza di CommandLineBuilder.

Si applica a