共用方式為


HttpLoggingServicesExtensions.AddHttpLoggingInterceptor<T> 方法

定義

在 DI 容器中將指定的型別註冊為 IHttpLoggingInterceptor

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpLoggingInterceptor<T> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where T : class, Microsoft.AspNetCore.HttpLogging.IHttpLoggingInterceptor;
static member AddHttpLoggingInterceptor : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'T : null and 'T :> Microsoft.AspNetCore.HttpLogging.IHttpLoggingInterceptor)
<Extension()>
Public Function AddHttpLoggingInterceptor(Of T As {Class, IHttpLoggingInterceptor}) (services As IServiceCollection) As IServiceCollection

類型參數

T

實作 的型別 IHttpLoggingInterceptor

參數

services
IServiceCollection

服務集合。

傳回

用於鏈結的原始服務集合。

適用於