EndpointRoutingApplicationBuilderExtensions.UseEndpoints 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.
Adds endpoint execution to the specified IApplicationBuilder with the EndpointDataSource instances built from the configured IEndpointRouteBuilder. This middleware executes the Endpoint associated with the current request.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseEndpoints(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ builder, Action<Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^> ^ configure);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseEndpoints(this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, Action<Microsoft.AspNetCore.Routing.IEndpointRouteBuilder> configure);
static member UseEndpoints : Microsoft.AspNetCore.Builder.IApplicationBuilder * Action<Microsoft.AspNetCore.Routing.IEndpointRouteBuilder> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseEndpoints (builder As IApplicationBuilder, configure As Action(Of IEndpointRouteBuilder)) As IApplicationBuilder
Parameters
- builder
- IApplicationBuilder
The IApplicationBuilder to add the middleware to.
- configure
- Action<IEndpointRouteBuilder>
An Action<T> to configure the provided IEndpointRouteBuilder.
Returns
A reference to this instance after the operation has completed.
Remarks
A call to UseEndpoints(IApplicationBuilder, Action<IEndpointRouteBuilder>) must be preceded by a call to UseRouting(IApplicationBuilder) for the same IApplicationBuilder instance.
Routing adds a point in the middleware pipeline where routing decisions are made and an Endpoint is associated with the HttpContext. Middleware between UseRouting(IApplicationBuilder) and UseEndpoints(IApplicationBuilder, Action<IEndpointRouteBuilder>) may observe or change the Endpoint associated with the HttpContext.