CommandLineBuilderExtensions.AddMiddleware 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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。