ApplicationMetadataServiceCollectionExtensions.AddApplicationMetadata Method

Definition

Overloads

AddApplicationMetadata(IServiceCollection, IConfigurationSection)

Adds an instance of ApplicationMetadata to a dependency injection container.

AddApplicationMetadata(IServiceCollection, Action<ApplicationMetadata>)

Adds an instance of ApplicationMetadata to a dependency injection container.

AddApplicationMetadata(IServiceCollection, IConfigurationSection)

Source:
ApplicationMetadataServiceCollectionExtensions.cs

Adds an instance of ApplicationMetadata to a dependency injection container.

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

Parameters

services
IServiceCollection

The dependency injection container to add the instance to.

section
IConfigurationSection

The configuration section to bind.

Returns

The value of services.

Exceptions

section or section is null.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.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)

AddApplicationMetadata(IServiceCollection, Action<ApplicationMetadata>)

Source:
ApplicationMetadataServiceCollectionExtensions.cs

Adds an instance of ApplicationMetadata to a dependency injection container.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddApplicationMetadata (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.AmbientMetadata.ApplicationMetadata> configure);

Parameters

services
IServiceCollection

The dependency injection container to add the instance to.

configure
Action<ApplicationMetadata>

The delegate to configure ApplicationMetadata with.

Returns

The value of services>.

Exceptions

services or configure is null.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.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)