HttpServiceCollectionExtensions.AddHttpContextAccessor 方法

定义

为服务添加默认实现 IHttpContextAccessor

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

参数

返回

服务集合。

适用于