ApplicationMetadataServiceCollectionExtensions.AddApplicationMetadata Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
Adds an instance of ApplicationMetadata to a dependency injection container.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddApplicationMetadata(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Microsoft::Extensions::Configuration::IConfigurationSection ^ section);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddApplicationMetadata (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfigurationSection section);
static member AddApplicationMetadata : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.Configuration.IConfigurationSection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddApplicationMetadata (services As IServiceCollection, section As IConfigurationSection) As IServiceCollection
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) |
Adds an instance of ApplicationMetadata to a dependency injection container.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddApplicationMetadata(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::AmbientMetadata::ApplicationMetadata ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddApplicationMetadata (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.AmbientMetadata.ApplicationMetadata> configure);
static member AddApplicationMetadata : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.AmbientMetadata.ApplicationMetadata> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddApplicationMetadata (services As IServiceCollection, configure As Action(Of ApplicationMetadata)) As IServiceCollection
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) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: