共用方式為


RoutingServiceCollectionExtensions.AddRouting 方法

定義

多載

AddRouting(IServiceCollection)

新增路由要求所需的服務。

AddRouting(IServiceCollection, Action<RouteOptions>)

新增路由要求所需的服務。

AddRouting(IServiceCollection)

來源:
RoutingServiceCollectionExtensions.cs
來源:
RoutingServiceCollectionExtensions.cs
來源:
RoutingServiceCollectionExtensions.cs

新增路由要求所需的服務。

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddRouting (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddRouting : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddRouting (services As IServiceCollection) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollection

傳回

IServiceCollection,以便鏈結其他呼叫。

適用於

AddRouting(IServiceCollection, Action<RouteOptions>)

來源:
RoutingServiceCollectionExtensions.cs
來源:
RoutingServiceCollectionExtensions.cs
來源:
RoutingServiceCollectionExtensions.cs

新增路由要求所需的服務。

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddRouting (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Routing.RouteOptions> configureOptions);
static member AddRouting : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Routing.RouteOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddRouting (services As IServiceCollection, configureOptions As Action(Of RouteOptions)) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollection

configureOptions
Action<RouteOptions>

用來設定中介軟體的路由選項。

傳回

IServiceCollection,以便鏈結其他呼叫。

適用於