LatencyContextExtensions.AddLatencyContext Method

Definition

Overloads

AddLatencyContext(IServiceCollection)

Source:
LatencyContextExtensions.cs

Adds latency context.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddLatencyContext (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);

Parameters

services
IServiceCollection

The dependency injection container.

Returns

The value of services.

Applies to

.NET 9 (package-provided) 和其他版本
产品 版本
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)

AddLatencyContext(IServiceCollection, IConfigurationSection)

Source:
LatencyContextExtensions.cs

Adds latency context.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddLatencyContext (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfigurationSection section);

Parameters

services
IServiceCollection

The dependency injection container.

section
IConfigurationSection

The configuration of LatencyContextOptions.

Returns

The value of services.

Applies to

.NET 9 (package-provided) 和其他版本
产品 版本
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)

AddLatencyContext(IServiceCollection, Action<LatencyContextOptions>)

Source:
LatencyContextExtensions.cs

Adds latency context.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddLatencyContext (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Diagnostics.Latency.LatencyContextOptions> configure);

Parameters

services
IServiceCollection

The dependency injection container.

configure
Action<LatencyContextOptions>

The LatencyContextOptions configuration delegate.

Returns

The value of services.

Applies to

.NET 9 (package-provided) 和其他版本
产品 版本
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)