共用方式為


RouteHandlerServices.Map 方法

定義

使用自訂函式註冊端點,以建構其處理常式的要求委派,以及填入端點的中繼資料。 適用于 RequestDelegateGenerator 中的取用。

public static Microsoft.AspNetCore.Builder.RouteHandlerBuilder Map (Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, Delegate handler, System.Collections.Generic.IEnumerable<string>? httpMethods, Func<System.Reflection.MethodInfo,Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions?,Microsoft.AspNetCore.Http.RequestDelegateMetadataResult> populateMetadata, Func<Delegate,Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions,Microsoft.AspNetCore.Http.RequestDelegateMetadataResult?,Microsoft.AspNetCore.Http.RequestDelegateResult> createRequestDelegate);
static member Map : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * Delegate * seq<string> * Func<System.Reflection.MethodInfo, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions, Microsoft.AspNetCore.Http.RequestDelegateMetadataResult> * Func<Delegate, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions, Microsoft.AspNetCore.Http.RequestDelegateMetadataResult, Microsoft.AspNetCore.Http.RequestDelegateResult> -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder
Public Shared Function Map (endpoints As IEndpointRouteBuilder, pattern As String, handler As Delegate, httpMethods As IEnumerable(Of String), populateMetadata As Func(Of MethodInfo, RequestDelegateFactoryOptions, RequestDelegateMetadataResult), createRequestDelegate As Func(Of Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult, RequestDelegateResult)) As RouteHandlerBuilder

參數

endpoints
IEndpointRouteBuilder

IEndpointRouteBuilder 加入路由的 。

pattern
String

路由模式。

handler
Delegate

比對端點時所執行的委派。

httpMethods
IEnumerable<String>

支援的 HTTP 方法集合。

populateMetadata
Func<MethodInfo,RequestDelegateFactoryOptions,RequestDelegateMetadataResult>

用於填入端點中繼資料的委派。

createRequestDelegate
Func<Delegate,RequestDelegateFactoryOptions,RequestDelegateMetadataResult,RequestDelegateResult>

用於建構 RequestDelegate 的委派。

傳回

適用於