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>)

Source:
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 >。

适用于