CommandLineBuilderExtensions.AddMiddleware 方法

定义

重载

AddMiddleware(CommandLineBuilder, Action<InvocationContext>, MiddlewareOrder)

在调用命令处理程序之前,将中间件委托添加到调用的调用管道。

AddMiddleware(CommandLineBuilder, InvocationMiddleware, MiddlewareOrder)

在调用命令处理程序之前,将中间件委托添加到调用的调用管道。

AddMiddleware(CommandLineBuilder, Action<InvocationContext>, MiddlewareOrder)

在调用命令处理程序之前,将中间件委托添加到调用的调用管道。

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

参数

builder
CommandLineBuilder

命令行生成器。

onInvoke
Action<InvocationContext>

将在调用命令处理程序之前调用的委托。

order
MiddlewareOrder

一个 值,该值指示相对于管道中其他委托的调用顺序。

返回

的同一 CommandLineBuilder实例。

适用于

AddMiddleware(CommandLineBuilder, InvocationMiddleware, MiddlewareOrder)

在调用命令处理程序之前,将中间件委托添加到调用的调用管道。

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

参数

builder
CommandLineBuilder

命令行生成器。

middleware
InvocationMiddleware

将在调用命令处理程序之前调用的委托。

order
MiddlewareOrder

一个 值,该值指示相对于管道中其他委托的调用顺序。

返回

的同一 CommandLineBuilder实例。

适用于