ServiceCollection クラス

定義

IServiceCollectionの既定の実装。

public ref class ServiceCollection : Microsoft::Extensions::DependencyInjection::IServiceCollection, System::Collections::Generic::ICollection<Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^>, System::Collections::Generic::IEnumerable<Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^>, System::Collections::Generic::IList<Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^>
public class ServiceCollection : Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Collections.Generic.ICollection<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IEnumerable<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IList<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>
type ServiceCollection = class
    interface IServiceCollection
    interface IList<ServiceDescriptor>
    interface ICollection<ServiceDescriptor>
    interface seq<ServiceDescriptor>
    interface IEnumerable
type ServiceCollection = class
    interface IServiceCollection
    interface ICollection<ServiceDescriptor>
    interface seq<ServiceDescriptor>
    interface IEnumerable
    interface IList<ServiceDescriptor>
Public Class ServiceCollection
Implements ICollection(Of ServiceDescriptor), IEnumerable(Of ServiceDescriptor), IList(Of ServiceDescriptor), IServiceCollection
継承
ServiceCollection
実装

コンストラクター

名前 説明
ServiceCollection()

ServiceCollection クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
Count

ICollection<T>に含まれる要素の数を取得します。

IsReadOnly

ICollection<T>が読み取り専用かどうかを示す値を取得します。

Item[Int32]

指定したインデックス位置にある要素を取得または設定します。

メソッド

名前 説明
Clear()

ICollection<T>からすべての項目を削除します。

Contains(ServiceDescriptor)

ICollection<T>に特定の値が含まれているかどうかを判断します。

CopyTo(ServiceDescriptor[], Int32)

特定のICollection<T>インデックスから始まるArrayの要素をArrayにコピーします。

Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetEnumerator()

コレクションを反復処理する列挙子を返します。

GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IndexOf(ServiceDescriptor)

IList<T>内の特定の項目のインデックスを決定します。

Insert(Int32, ServiceDescriptor)

指定したインデックス位置にある IList<T> に項目を挿入します。

MakeReadOnly()

このコレクションを読み取り専用にします。

MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
Remove(ServiceDescriptor)

特定のオブジェクトの最初の出現箇所を ICollection<T>から削除します。

RemoveAt(Int32)

指定したインデックス位置にある IList<T> 項目を削除します。

ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

名前 説明
ICollection<ServiceDescriptor>.Add(ServiceDescriptor)

ICollection<T>に項目を追加します。

IEnumerable.GetEnumerator()

コレクションを反復処理する列挙子を返します。

拡張メソッド

名前 説明
Add(IServiceCollection, IEnumerable<ServiceDescriptor>)

ServiceDescriptorに一連のcollectionを追加します。

Add(IServiceCollection, ServiceDescriptor)

指定した descriptorcollectionに追加します。

AddHostedService<THostedService>(IServiceCollection, Func<IServiceProvider,THostedService>)

指定した型の IHostedService 登録を追加します。

AddHostedService<THostedService>(IServiceCollection)

指定した型の IHostedService 登録を追加します。

AddHybridCache(IServiceCollection, Action<HybridCacheOptions>)

多層キャッシュ サービスのサポートを追加します。

AddHybridCache(IServiceCollection)

多層キャッシュ サービスのサポートを追加します。

AddKeyedHybridCache(IServiceCollection, Object, Action<HybridCacheOptions>)

キー付き登録を使用した多層キャッシュ サービスのサポートを追加します。

AddKeyedHybridCache(IServiceCollection, Object, String, Action<HybridCacheOptions>)

キー付き登録を使用した多層キャッシュ サービスのサポートを追加します。

AddKeyedHybridCache(IServiceCollection, Object, String)

キー付き登録を使用した多層キャッシュ サービスのサポートを追加します。

AddKeyedHybridCache(IServiceCollection, Object)

キー付き登録を使用した多層キャッシュ サービスのサポートを追加します。

AddKeyedScoped(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

serviceTypeで指定されたファクトリを使用して、implementationFactoryで指定された型のスコープサービスを、指定したIServiceCollectionに追加します。

AddKeyedScoped(IServiceCollection, Type, Object, Type)

serviceTypeで指定された型の実装を使用して、implementationTypeで指定された型のスコープ付きサービスを、指定したIServiceCollectionに追加します。

AddKeyedScoped(IServiceCollection, Type, Object)

指定したserviceTypeに、IServiceCollectionで指定された型のスコープサービスを追加します。

AddKeyedScoped<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

TServiceで指定したファクトリを使用して、TImplementationで指定された実装型を持つ、implementationFactoryで指定された型のスコープサービスを、指定したIServiceCollectionに追加します。

AddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

TServiceで指定された実装型を持つTImplementationで指定された型のスコープサービスを、指定したIServiceCollectionに追加します。

AddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

TServiceで指定されたファクトリを使用して、implementationFactoryで指定された型のスコープサービスを、指定したIServiceCollectionに追加します。

AddKeyedScoped<TService>(IServiceCollection, Object)

指定したTServiceに、IServiceCollectionで指定された型のスコープサービスを追加します。

AddKeyedSingleton(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

serviceTypeで指定されたファクトリを使用して、implementationFactoryで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedSingleton(IServiceCollection, Type, Object, Object)

serviceTypeで指定されたインスタンスを持つimplementationInstanceで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedSingleton(IServiceCollection, Type, Object, Type)

serviceTypeで指定された型の実装を使用して、implementationTypeで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedSingleton(IServiceCollection, Type, Object)

serviceTypeで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

TServiceで指定されたファクトリを使用して、TImplementationで指定された実装型を持つ、implementationFactoryで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

TServiceで指定された実装型を持つTImplementationで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedSingleton<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

TServiceで指定されたファクトリを使用して、implementationFactoryで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedSingleton<TService>(IServiceCollection, Object, TService)

TServiceで指定されたインスタンスを持つimplementationInstanceで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedSingleton<TService>(IServiceCollection, Object)

TServiceで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddKeyedTransient(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

serviceTypeで指定されたファクトリを使用して、implementationFactoryで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddKeyedTransient(IServiceCollection, Type, Object, Type)

serviceTypeで指定された型の実装を使用して、implementationTypeで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddKeyedTransient(IServiceCollection, Type, Object)

serviceTypeで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddKeyedTransient<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

TServiceで指定されたファクトリを使用して、TImplementationで指定された実装型を持つimplementationFactoryで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

TServiceで指定された実装型を持つTImplementationで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddKeyedTransient<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

TServiceで指定されたファクトリを使用して、implementationFactoryで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddKeyedTransient<TService>(IServiceCollection, Object)

TServiceで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddLogging(IServiceCollection, Action<ILoggingBuilder>)

指定した IServiceCollectionにログ サービスを追加します。

AddLogging(IServiceCollection)

指定した IServiceCollectionにログ サービスを追加します。

AddOptions(IServiceCollection)

オプションを使用するために必要なサービスを追加します。

AddOptions<TOptions>(IServiceCollection, String)

同じ名前付き TOptions の Configure 呼び出しを基になるサービス コレクションに転送するオプション ビルダーを取得します。

AddOptions<TOptions>(IServiceCollection)

同じ TOptions の Configure 呼び出しを基になるサービス コレクションに転送するオプション ビルダーを取得します。

AddOptionsWithValidateOnStart<TOptions,TValidateOptions>(IServiceCollection, String)

オプションを使用するために必要なサービスを追加し、実行時ではなく起動時にオプション検証チェックを適用します。

AddOptionsWithValidateOnStart<TOptions>(IServiceCollection, String)

オプションを使用するために必要なサービスを追加し、実行時ではなく起動時にオプション検証チェックを適用します。

AddScoped(IServiceCollection, Type, Func<IServiceProvider,Object>)

serviceTypeで指定されたファクトリを使用して、implementationFactoryで指定された型のスコープサービスを、指定したIServiceCollectionに追加します。

AddScoped(IServiceCollection, Type, Type)

serviceTypeで指定された型の実装を使用して、implementationTypeで指定された型のスコープ付きサービスを、指定したIServiceCollectionに追加します。

AddScoped(IServiceCollection, Type)

指定したserviceTypeに、IServiceCollectionで指定された型のスコープサービスを追加します。

AddScoped<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

TServiceで指定したファクトリを使用して、TImplementationで指定された実装型を持つ、implementationFactoryで指定された型のスコープサービスを、指定したIServiceCollectionに追加します。

AddScoped<TService,TImplementation>(IServiceCollection)

TServiceで指定された実装型を持つTImplementationで指定された型のスコープサービスを、指定したIServiceCollectionに追加します。

AddScoped<TService>(IServiceCollection, Func<IServiceProvider,TService>)

TServiceで指定されたファクトリを使用して、implementationFactoryで指定された型のスコープサービスを、指定したIServiceCollectionに追加します。

AddScoped<TService>(IServiceCollection)

指定したTServiceに、IServiceCollectionで指定された型のスコープサービスを追加します。

AddSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)

serviceTypeで指定されたファクトリを使用して、implementationFactoryで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSingleton(IServiceCollection, Type, Object)

serviceTypeで指定されたインスタンスを持つimplementationInstanceで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSingleton(IServiceCollection, Type, Type)

serviceTypeで指定された型の実装を使用して、implementationTypeで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSingleton(IServiceCollection, Type)

serviceTypeで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

TServiceで指定されたファクトリを使用して、TImplementationで指定された実装型を持つ、implementationFactoryで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSingleton<TService,TImplementation>(IServiceCollection)

TServiceで指定された実装型を持つTImplementationで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

TServiceで指定されたファクトリを使用して、implementationFactoryで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSingleton<TService>(IServiceCollection, TService)

TServiceで指定されたインスタンスを持つimplementationInstanceで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSingleton<TService>(IServiceCollection)

TServiceで指定された型のシングルトン サービスを、指定したIServiceCollectionに追加します。

AddSystemd(IServiceCollection)

IHostからservicesにビルドされたSystemdLifetimeの有効期間を構成し、アプリケーションの起動と停止の通知メッセージを提供し、システム形式にコンソール ログを構成します。

AddTransient(IServiceCollection, Type, Func<IServiceProvider,Object>)

serviceTypeで指定されたファクトリを使用して、implementationFactoryで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddTransient(IServiceCollection, Type, Type)

serviceTypeで指定された型の実装を使用して、implementationTypeで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddTransient(IServiceCollection, Type)

serviceTypeで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddTransient<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

TServiceで指定されたファクトリを使用して、TImplementationで指定された実装型を持つimplementationFactoryで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddTransient<TService,TImplementation>(IServiceCollection)

TServiceで指定された実装型を持つTImplementationで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddTransient<TService>(IServiceCollection, Func<IServiceProvider,TService>)

TServiceで指定されたファクトリを使用して、implementationFactoryで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddTransient<TService>(IServiceCollection)

TServiceで指定された型の一時的なサービスを、指定したIServiceCollectionに追加します。

AddWindowsService(IServiceCollection, Action<WindowsServiceLifetimeOptions>)

IHostからservicesにビルドされたWindowsServiceLifetimeの有効期間を構成し、アプリケーション名を既定のソース名として使用してイベント ログにログを記録できるようにします。

AddWindowsService(IServiceCollection)

IHostからservicesにビルドされたWindowsServiceLifetimeの有効期間を構成し、アプリケーション名を既定のソース名として使用してイベント ログにログを記録できるようにします。

BuildServiceProvider(IServiceCollection, Boolean)

指定したServiceProviderからサービスを含むIServiceCollectionを作成し、必要に応じてスコープの検証を有効にします。

BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

指定したServiceProviderからサービスを含むIServiceCollectionを作成し、必要に応じてスコープの検証を有効にします。

BuildServiceProvider(IServiceCollection)

指定されたServiceProviderからサービスを含むIServiceCollectionを作成します。

Configure<TOptions>(IServiceCollection, Action<TOptions>)

特定の種類のオプションを構成するために使用するアクションを登録します。 注: これらはすべての PostConfigure<TOptions>(IServiceCollection, Action<TOptions>)の前に実行されます。

Configure<TOptions>(IServiceCollection, String, Action<TOptions>)

特定の種類のオプションを構成するために使用するアクションを登録します。 注: これらはすべての PostConfigure<TOptions>(IServiceCollection, Action<TOptions>)の前に実行されます。

ConfigureAll<TOptions>(IServiceCollection, Action<TOptions>)

特定の種類のオプションのすべてのインスタンスを構成するために使用するアクションを登録します。

ConfigureOptions(IServiceCollection, Object)

すべての IConfigureOptions<TOptions>IPostConfigureOptions<TOptions>、および IValidateOptions<TOptions> が登録されるオブジェクトを登録します。

ConfigureOptions(IServiceCollection, Type)

すべての IConfigureOptions<TOptions>IPostConfigureOptions<TOptions>、および IValidateOptions<TOptions> が登録される型を登録します。

ConfigureOptions<TConfigureOptions>(IServiceCollection)

すべての IConfigureOptions<TOptions>IPostConfigureOptions<TOptions>、および IValidateOptions<TOptions> が登録される型を登録します。

PostConfigure<TOptions>(IServiceCollection, Action<TOptions>)

特定の種類のオプションを初期化するために使用するアクションを登録します。 注: これらはすべての Configure<TOptions>(IServiceCollection, Action<TOptions>)の後で実行されます。

PostConfigure<TOptions>(IServiceCollection, String, Action<TOptions>)

特定の種類のオプションを構成するために使用するアクションを登録します。 注: これらはすべての Configure<TOptions>(IServiceCollection, Action<TOptions>)の後で実行されます。

PostConfigureAll<TOptions>(IServiceCollection, Action<TOptions>)

特定の種類のオプションのすべてのインスタンスを構成した後に使用するアクションを登録します。 注: これらはすべての Configure<TOptions>(IServiceCollection, Action<TOptions>)の後で実行されます。

RemoveAll(IServiceCollection, Type)

serviceTypeIServiceCollection型のすべてのサービスを削除します。

RemoveAll<T>(IServiceCollection)

TIServiceCollection型のすべてのサービスを削除します。

RemoveAllKeyed(IServiceCollection, Type, Object)

serviceTypeIServiceCollection型のすべてのサービスを削除します。

RemoveAllKeyed<T>(IServiceCollection, Object)

TIServiceCollection型のすべてのサービスを削除します。

Replace(IServiceCollection, ServiceDescriptor)

IServiceCollectionと同じサービスの種類を持つdescriptorの最初のサービスを削除し、コレクションにdescriptorを追加します。

TryAdd(IServiceCollection, IEnumerable<ServiceDescriptor>)

サービスの種類がまだ登録されていない場合は、指定した descriptorscollection に追加します。

TryAdd(IServiceCollection, ServiceDescriptor)

サービスの種類がまだ登録されていない場合は、指定した descriptorcollection に追加します。

TryAddEnumerable(IServiceCollection, IEnumerable<ServiceDescriptor>)

同じServiceDescriptorを持つ既存の記述子と、ServiceTypeにまだ存在しない実装がある場合は、指定したservicesを追加します。

TryAddEnumerable(IServiceCollection, ServiceDescriptor)

同じServiceDescriptorを持つ既存の記述子と、ServiceTypeにまだ存在しない実装がある場合は、servicesを追加します。

TryAddKeyedScoped(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

serviceで指定されたファクトリを使用して、指定したScopedimplementationFactory サービスとしてcollectionに追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedScoped(IServiceCollection, Type, Object, Type)

サービスの種類がまだ登録されていない場合は、指定したserviceScoped実装を持つimplementationType サービスとしてcollectionに追加します。

TryAddKeyedScoped(IServiceCollection, Type, Object)

指定した serviceScoped サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

サービスの種類がまだ登録されていない場合は、指定したTServiceScopedで指定したTImplementation サービス実装型としてcollectionに追加します。

TryAddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

TServiceで指定されたファクトリを使用して、指定したScopedimplementationFactory サービスとしてservicesに追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedScoped<TService>(IServiceCollection, Object)

指定した TServiceScoped サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedSingleton(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

serviceで指定されたファクトリを使用して、指定したSingletonimplementationFactory サービスとしてcollectionに追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedSingleton(IServiceCollection, Type, Object, Type)

サービスの種類がまだ登録されていない場合は、指定したserviceSingleton実装を持つimplementationType サービスとしてcollectionに追加します。

TryAddKeyedSingleton(IServiceCollection, Type, Object)

指定した serviceSingleton サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

サービスの種類がまだ登録されていない場合は、指定したTServiceSingletonで指定したTImplementation サービス実装型としてcollectionに追加します。

TryAddKeyedSingleton<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

TServiceで指定されたファクトリを使用して、指定したSingletonimplementationFactory サービスとしてservicesに追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedSingleton<TService>(IServiceCollection, Object, TService)

サービスの種類がまだ登録されていない場合は、TService で指定されたインスタンスを持つSingleton サービスとして、指定したinstancecollectionに追加します。

TryAddKeyedSingleton<TService>(IServiceCollection, Object)

指定した TServiceSingleton サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedTransient(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)

serviceで指定されたファクトリを使用して、指定したTransientimplementationFactory サービスとしてcollectionに追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedTransient(IServiceCollection, Type, Object, Type)

サービスの種類がまだ登録されていない場合は、指定したserviceTransient実装を持つimplementationType サービスとしてcollectionに追加します。

TryAddKeyedTransient(IServiceCollection, Type, Object)

指定した serviceTransient サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

サービスの種類がまだ登録されていない場合は、指定したTServiceTransientで指定したTImplementation サービス実装型としてcollectionに追加します。

TryAddKeyedTransient<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

TServiceで指定されたファクトリを使用して、指定したTransientimplementationFactory サービスとしてservicesに追加します (サービスの種類がまだ登録されていない場合)。

TryAddKeyedTransient<TService>(IServiceCollection, Object)

指定した TServiceTransient サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddScoped(IServiceCollection, Type, Func<IServiceProvider,Object>)

serviceで指定されたファクトリを使用して、指定したScopedimplementationFactory サービスとしてcollectionに追加します (サービスの種類がまだ登録されていない場合)。

TryAddScoped(IServiceCollection, Type, Type)

サービスの種類がまだ登録されていない場合は、指定したserviceScoped実装を持つimplementationType サービスとしてcollectionに追加します。

TryAddScoped(IServiceCollection, Type)

指定した serviceScoped サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddScoped<TService,TImplementation>(IServiceCollection)

サービスの種類がまだ登録されていない場合は、指定したTServiceScopedで指定したTImplementation サービス実装型としてcollectionに追加します。

TryAddScoped<TService>(IServiceCollection, Func<IServiceProvider,TService>)

TServiceで指定されたファクトリを使用して、指定したScopedimplementationFactory サービスとしてservicesに追加します (サービスの種類がまだ登録されていない場合)。

TryAddScoped<TService>(IServiceCollection)

指定した TServiceScoped サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)

serviceで指定されたファクトリを使用して、指定したSingletonimplementationFactory サービスとしてcollectionに追加します (サービスの種類がまだ登録されていない場合)。

TryAddSingleton(IServiceCollection, Type, Type)

サービスの種類がまだ登録されていない場合は、指定したserviceSingleton実装を持つimplementationType サービスとしてcollectionに追加します。

TryAddSingleton(IServiceCollection, Type)

指定した serviceSingleton サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddSingleton<TService,TImplementation>(IServiceCollection)

サービスの種類がまだ登録されていない場合は、指定したTServiceSingletonで指定したTImplementation サービス実装型としてcollectionに追加します。

TryAddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

TServiceで指定されたファクトリを使用して、指定したSingletonimplementationFactory サービスとしてservicesに追加します (サービスの種類がまだ登録されていない場合)。

TryAddSingleton<TService>(IServiceCollection, TService)

サービスの種類がまだ登録されていない場合は、TService で指定されたインスタンスを持つSingleton サービスとして、指定したinstancecollectionに追加します。

TryAddSingleton<TService>(IServiceCollection)

指定した TServiceSingleton サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddTransient(IServiceCollection, Type, Func<IServiceProvider,Object>)

serviceで指定されたファクトリを使用して、指定したTransientimplementationFactory サービスとしてcollectionに追加します (サービスの種類がまだ登録されていない場合)。

TryAddTransient(IServiceCollection, Type, Type)

サービスの種類がまだ登録されていない場合は、指定したserviceTransient実装を持つimplementationType サービスとしてcollectionに追加します。

TryAddTransient(IServiceCollection, Type)

指定した serviceTransient サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

TryAddTransient<TService,TImplementation>(IServiceCollection)

サービスの種類がまだ登録されていない場合は、指定したTServiceTransientで指定したTImplementation サービス実装型としてcollectionに追加します。

TryAddTransient<TService>(IServiceCollection, Func<IServiceProvider,TService>)

TServiceで指定されたファクトリを使用して、指定したTransientimplementationFactory サービスとしてservicesに追加します (サービスの種類がまだ登録されていない場合)。

TryAddTransient<TService>(IServiceCollection)

指定した TServiceTransient サービスとして collection に追加します (サービスの種類がまだ登録されていない場合)。

適用対象