共用方式為


ApplicationMetadataServiceCollectionExtensions.AddApplicationMetadata 方法

定義

多載

AddApplicationMetadata(IServiceCollection, IConfigurationSection)

將的 ApplicationMetadata 實例加入至相依性插入容器。

AddApplicationMetadata(IServiceCollection, Action<ApplicationMetadata>)

將的 ApplicationMetadata 實例加入至相依性插入容器。

AddApplicationMetadata(IServiceCollection, IConfigurationSection)

來源:
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>)

來源:
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

適用於