Bagikan melalui


EndpointRoutingApplicationBuilderExtensions.UseRouting Metode

Definisi

Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware Menambahkan middleware ke yang ditentukanIApplicationBuilder.

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

Parameter

builder
IApplicationBuilder

untuk IApplicationBuilder menambahkan middleware.

Mengembalikan

Referensi ke instans ini setelah operasi selesai.

Keterangan

Panggilan ke UseRouting(IApplicationBuilder) harus diikuti dengan panggilan ke UseEndpoints(IApplicationBuilder, Action<IEndpointRouteBuilder>) untuk instans yang sama IApplicationBuilder .

Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware mendefinisikan titik dalam alur middleware tempat keputusan perutean dibuat, dan Endpoint dikaitkan dengan HttpContext. Microsoft.AspNetCore.Routing.EndpointMiddleware mendefinisikan titik dalam alur middleware tempat arus Endpoint dijalankan. Middleware antara Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware dan Microsoft.AspNetCore.Routing.EndpointMiddleware dapat mengamati atau mengubah yang Endpoint terkait dengan HttpContext.

Berlaku untuk