ServiceCollectionDescriptorExtensions.TryAddKeyedScoped メソッド

定義

オーバーロード

名前 説明
TryAddKeyedScoped(IServiceCollection, Type, Object, Type)

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

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

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

TryAddKeyedScoped(IServiceCollection, Type, Object)

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

TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

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

TryAddKeyedScoped<TService>(IServiceCollection, Object)

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

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

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

TryAddKeyedScoped(IServiceCollection, Type, Object, Type)

ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs

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

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service, System::Object ^ serviceKey, Type ^ implementationType);
public static void TryAddKeyedScoped(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service, object? serviceKey, Type implementationType);
static member TryAddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * obj * Type -> unit
<Extension()>
Public Sub TryAddKeyedScoped (collection As IServiceCollection, service As Type, serviceKey As Object, implementationType As Type)

パラメーター

service
Type

登録するサービスの種類。

serviceKey
Object

サービス キー。

implementationType
Type

サービスの実装の種類。

こちらもご覧ください

適用対象

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

ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs

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

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, System::Object ^> ^ implementationFactory);
public static void TryAddKeyedScoped(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service, object? serviceKey, Func<IServiceProvider,object?,object> implementationFactory);
public static void TryAddKeyedScoped(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service, object? serviceKey, Func<IServiceProvider,object,object> implementationFactory);
static member TryAddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * obj * Func<IServiceProvider, obj, obj> -> unit
<Extension()>
Public Sub TryAddKeyedScoped (collection As IServiceCollection, service As Type, serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, Object))

パラメーター

service
Type

登録するサービスの種類。

serviceKey
Object

サービス キー。

implementationFactory
Func<IServiceProvider,Object,Object>

サービスを作成するファクトリ。

こちらもご覧ください

適用対象

TryAddKeyedScoped(IServiceCollection, Type, Object)

ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs

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

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service, System::Object ^ serviceKey);
public static void TryAddKeyedScoped(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service, object? serviceKey);
static member TryAddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * obj -> unit
<Extension()>
Public Sub TryAddKeyedScoped (collection As IServiceCollection, service As Type, serviceKey As Object)

パラメーター

service
Type

登録するサービスの種類。

serviceKey
Object

サービス キー。

こちらもご覧ください

適用対象

TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs

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

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService[System::Runtime::CompilerServices::Extension]
 static void TryAddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, System::Object ^ serviceKey);
public static void TryAddKeyedScoped<TService,TImplementation>(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, object? serviceKey) where TService : class where TImplementation : class, TService;
static member TryAddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddKeyedScoped(Of TService As Class, TImplementation As Class) (collection As IServiceCollection, serviceKey As Object)

型パラメーター

TService

追加するサービスの種類。

TImplementation

使用する実装の型。

パラメーター

serviceKey
Object

サービス キー。

こちらもご覧ください

適用対象

TryAddKeyedScoped<TService>(IServiceCollection, Object)

ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs

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

public:
generic <typename TService>
 where TService : class[System::Runtime::CompilerServices::Extension]
 static void TryAddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, System::Object ^ serviceKey);
public static void TryAddKeyedScoped<TService>(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, object? serviceKey) where TService : class;
static member TryAddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddKeyedScoped(Of TService As Class) (collection As IServiceCollection, serviceKey As Object)

型パラメーター

TService

追加するサービスの種類。

パラメーター

serviceKey
Object

サービス キー。

こちらもご覧ください

適用対象

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

ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs
ソース:
ServiceCollectionDescriptorExtensions.Keyed.cs

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

public:
generic <typename TService>
 where TService : class[System::Runtime::CompilerServices::Extension]
 static void TryAddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, TService> ^ implementationFactory);
public static void TryAddKeyedScoped<TService>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, object? serviceKey, Func<IServiceProvider,object?,TService> implementationFactory) where TService : class;
public static void TryAddKeyedScoped<TService>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, object? serviceKey, Func<IServiceProvider,object,TService> implementationFactory) where TService : class;
static member TryAddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Func<IServiceProvider, obj, 'Service (requires 'Service : null)> -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddKeyedScoped(Of TService As Class) (services As IServiceCollection, serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, TService))

型パラメーター

TService

追加するサービスの種類。

パラメーター

serviceKey
Object

サービス キー。

implementationFactory
Func<IServiceProvider,Object,TService>

サービスを作成するファクトリ。

こちらもご覧ください

適用対象