RouteHandlerServices.Map Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Registers an endpoint with custom functions for constructing a request delegate for its handler and populating metadata for the endpoint. Intended for consumption in the 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
Parameters
- endpoints
- IEndpointRouteBuilder
The IEndpointRouteBuilder to add the route to.
- pattern
- String
The route pattern.
- handler
- Delegate
The delegate executed when the endpoint is matched.
- httpMethods
- IEnumerable<String>
The set of supported HTTP methods.
- populateMetadata
- Func<MethodInfo,RequestDelegateFactoryOptions,RequestDelegateMetadataResult>
A delegate for populating endpoint metadata.
- createRequestDelegate
- Func<Delegate,RequestDelegateFactoryOptions,RequestDelegateMetadataResult,RequestDelegateResult>
A delegate for constructing a RequestDelegate.
Returns
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for