EndpointRoutingApplicationBuilderExtensions.UseRouting Método

Definición

Agrega un Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware middleware al especificado IApplicationBuilder.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseRouting(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ builder);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRouting (this Microsoft.AspNetCore.Builder.IApplicationBuilder builder);
static member UseRouting : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseRouting (builder As IApplicationBuilder) As IApplicationBuilder

Parámetros

builder
IApplicationBuilder

IApplicationBuilder al que se va a agregar el middleware.

Devoluciones

Una referencia a esta instancia después de que se haya completado la operación.

Comentarios

Una llamada a UseRouting(IApplicationBuilder) debe ir seguida de una llamada a UseEndpoints(IApplicationBuilder, Action<IEndpointRouteBuilder>) para la misma IApplicationBuilder instancia.

Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware define un punto de la canalización de middleware donde se toman decisiones de enrutamiento y un Endpoint está asociado a HttpContext. Microsoft.AspNetCore.Routing.EndpointMiddleware define un punto en la canalización de middleware donde se ejecuta el actualEndpoint. El middleware entre y Microsoft.AspNetCore.Routing.EndpointRoutingMiddlewareMicrosoft.AspNetCore.Routing.EndpointMiddleware puede observar o cambiar el Endpoint asociado a HttpContext.

Se aplica a