ServiceCollectionDescriptorExtensions.TryAddEnumerable メソッド

定義

オーバーロード

TryAddEnumerable(IServiceCollection, ServiceDescriptor)

ServiceDescriptor を同じくする既存の記述子と ServiceType にまだ存在しない実装の場合、services.. を追加します。Adds a ServiceDescriptor if an existing descriptor with the same ServiceType and an implementation that does not already exist in services...

TryAddEnumerable(IServiceCollection, IEnumerable<ServiceDescriptor>)

ServiceDescriptor を同じくする既存の記述子と ServiceType にまだ存在しない実装の場合、指定の services.. を追加します。Adds the specified ServiceDescriptors if an existing descriptor with the same ServiceType and an implementation that does not already exist in services...

TryAddEnumerable(IServiceCollection, ServiceDescriptor)

ServiceDescriptor を同じくする既存の記述子と ServiceType にまだ存在しない実装の場合、services.. を追加します。Adds a ServiceDescriptor if an existing descriptor with the same ServiceType and an implementation that does not already exist in services...

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddEnumerable(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ descriptor);
public static void TryAddEnumerable (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.DependencyInjection.ServiceDescriptor descriptor);
static member TryAddEnumerable : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.DependencyInjection.ServiceDescriptor -> unit
<Extension()>
Public Sub TryAddEnumerable (services As IServiceCollection, descriptor As ServiceDescriptor)

パラメーター

注釈

同じサービスの種類の複数の登録をサポートするサービスの種類のサービス実装を登録する場合は、TryAddEnumerable(IServiceCollection, ServiceDescriptor) を使用します。Use TryAddEnumerable(IServiceCollection, ServiceDescriptor) when registering a service implementation of a service type that supports multiple registrations of the same service type. Add(IServiceCollection, ServiceDescriptor) の使用はべき等ではなく、2回呼び出された場合、重複する ServiceDescriptor インスタンスを追加できます。Using Add(IServiceCollection, ServiceDescriptor) is not idempotent and can add duplicate ServiceDescriptor instances if called twice. TryAddEnumerable(IServiceCollection, ServiceDescriptor) を使用すると、複数の実装の種類を登録できなくなります。Using TryAddEnumerable(IServiceCollection, ServiceDescriptor) will prevent registration of multiple implementation types.

TryAddEnumerable(IServiceCollection, IEnumerable<ServiceDescriptor>)

ServiceDescriptor を同じくする既存の記述子と ServiceType にまだ存在しない実装の場合、指定の services.. を追加します。Adds the specified ServiceDescriptors if an existing descriptor with the same ServiceType and an implementation that does not already exist in services...

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddEnumerable(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::Collections::Generic::IEnumerable<Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^> ^ descriptors);
public static void TryAddEnumerable (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Collections.Generic.IEnumerable<Microsoft.Extensions.DependencyInjection.ServiceDescriptor> descriptors);
static member TryAddEnumerable : Microsoft.Extensions.DependencyInjection.IServiceCollection * seq<Microsoft.Extensions.DependencyInjection.ServiceDescriptor> -> unit
<Extension()>
Public Sub TryAddEnumerable (services As IServiceCollection, descriptors As IEnumerable(Of ServiceDescriptor))

パラメーター

注釈

同じサービスの種類の複数の登録をサポートするサービスの種類のサービス実装を登録する場合は、TryAddEnumerable(IServiceCollection, ServiceDescriptor) を使用します。Use TryAddEnumerable(IServiceCollection, ServiceDescriptor) when registering a service implementation of a service type that supports multiple registrations of the same service type. Add(IServiceCollection, ServiceDescriptor) の使用はべき等ではなく、2回呼び出された場合、重複する ServiceDescriptor インスタンスを追加できます。Using Add(IServiceCollection, ServiceDescriptor) is not idempotent and can add duplicate ServiceDescriptor instances if called twice. TryAddEnumerable(IServiceCollection, ServiceDescriptor) を使用すると、複数の実装の種類を登録できなくなります。Using TryAddEnumerable(IServiceCollection, ServiceDescriptor) will prevent registration of multiple implementation types.

適用対象