ApplicationMetadataServiceCollectionExtensions.AddApplicationMetadata 方法

定义

重载

AddApplicationMetadata(IServiceCollection, IConfigurationSection)

将 的 ApplicationMetadata 实例添加到依赖项注入容器。

AddApplicationMetadata(IServiceCollection, Action<ApplicationMetadata>)

将 的 ApplicationMetadata 实例添加到依赖项注入容器。

AddApplicationMetadata(IServiceCollection, IConfigurationSection)

Source:
ApplicationMetadataServiceCollectionExtensions.cs

将 的 ApplicationMetadata 实例添加到依赖项注入容器。

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

参数

services
IServiceCollection

要向其添加实例的依赖项注入容器。

section
IConfigurationSection

要绑定的配置节。

返回

services 的值。

例外

sectionsectionnull

适用于

AddApplicationMetadata(IServiceCollection, Action<ApplicationMetadata>)

Source:
ApplicationMetadataServiceCollectionExtensions.cs

将 的 ApplicationMetadata 实例添加到依赖项注入容器。

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

参数

services
IServiceCollection

要向其添加实例的依赖项注入容器。

configure
Action<ApplicationMetadata>

要配置的 ApplicationMetadata 委托。

返回

的值 services>。

例外

servicesconfigurenull

适用于