RoutingServiceCollectionExtensions.AddRouting 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddRouting(IServiceCollection) |
新增路由要求所需的服務。 |
AddRouting(IServiceCollection, Action<RouteOptions>) |
新增路由要求所需的服務。 |
AddRouting(IServiceCollection)
新增路由要求所需的服務。
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>)
新增路由要求所需的服務。
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,以便鏈結其他呼叫。