HttpServiceCollectionExtensions.AddHttpContextAccessor 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为服务添加默认实现 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
参数
- services
- IServiceCollection
返回
服务集合。