Compartir a través de


EndpointRoutingApplicationBuilderExtensions.UseEndpoints Método

Definición

Agrega un Microsoft.AspNetCore.Routing.EndpointMiddleware middleware al especificado IApplicationBuilder con las EndpointDataSource instancias compiladas a partir de configuradas IEndpointRouteBuilder. Microsoft.AspNetCore.Routing.EndpointMiddleware ejecutará el Endpoint asociado a la solicitud actual.

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

Parámetros

builder
IApplicationBuilder

IApplicationBuilder al que se va a agregar el middleware.

configure
Action<IEndpointRouteBuilder>

Action<T> para configurar el objeto IEndpointRouteBuilder proporcionado.

Devoluciones

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

Comentarios

Una llamada a UseEndpoints(IApplicationBuilder, Action<IEndpointRouteBuilder>) debe ir precedida de una llamada a UseRouting(IApplicationBuilder) 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