共用方式為


RouteHandlerServices.Map 方法

定義

多載

Map(IEndpointRouteBuilder, String, Delegate, IEnumerable<String>, Func<MethodInfo,RequestDelegateFactoryOptions,RequestDelegateMetadataResult>, Func<Delegate,RequestDelegateFactoryOptions,RequestDelegateMetadataResult, RequestDelegateResult>)

向自定義函式註冊端點,以建構其處理程式的要求委派,並填入端點的元數據。 適用於 RequestDelegateGenerator 中的取用。

Map(IEndpointRouteBuilder, String, Delegate, IEnumerable<String>, Func<MethodInfo,RequestDelegateFactoryOptions,RequestDelegateMetadataResult>, Func<Delegate,RequestDelegateFactoryOptions,RequestDelegateMetadataResult, RequestDelegateResult>, MethodInfo)

向自定義函式註冊端點,以建構其處理程式的要求委派,並填入端點的元數據。 適用於 RequestDelegateGenerator 中的取用。

Map(IEndpointRouteBuilder, String, Delegate, IEnumerable<String>, Func<MethodInfo,RequestDelegateFactoryOptions,RequestDelegateMetadataResult>, Func<Delegate,RequestDelegateFactoryOptions,RequestDelegateMetadataResult, RequestDelegateResult>)

來源:
RouteHandlerServices.cs

向自定義函式註冊端點,以建構其處理程式的要求委派,並填入端點的元數據。 適用於 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 的委派。

傳回

RouteHandlerBuilder >。

適用於

Map(IEndpointRouteBuilder, String, Delegate, IEnumerable<String>, Func<MethodInfo,RequestDelegateFactoryOptions,RequestDelegateMetadataResult>, Func<Delegate,RequestDelegateFactoryOptions,RequestDelegateMetadataResult, RequestDelegateResult>, MethodInfo)

向自定義函式註冊端點,以建構其處理程式的要求委派,並填入端點的元數據。 適用於 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, System.Reflection.MethodInfo methodInfo);
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> * System.Reflection.MethodInfo -> 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), methodInfo As MethodInfo) 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 的委派。

methodInfo
MethodInfo

與傳入委派相關聯的 MethodInfo。

傳回

RouteHandlerBuilder >。

適用於