ApplicationMetadataServiceCollectionExtensions.AddApplicationMetadata 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddApplicationMetadata(IServiceCollection, IConfigurationSection)
将 的 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
的值。
例外
section
或 section
为 null
。
适用于
AddApplicationMetadata(IServiceCollection, Action<ApplicationMetadata>)
将 的 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
>。
例外
services
或 configure
为 null
。