ServiceDescriptor.KeyedSingleton メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
KeyedSingleton(Type, Object, Func<IServiceProvider,Object,Object>)
指定したserviceType、implementationFactory、およびSingletonの有効期間を使用して、ServiceDescriptorのインスタンスを作成します。
public:
static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(Type ^ serviceType, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, System::Object ^> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton(Type serviceType, object? serviceKey, Func<IServiceProvider,object?,object> implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton(Type serviceType, object? serviceKey, Func<IServiceProvider,object,object> implementationFactory);
static member KeyedSingleton : Type * obj * Func<IServiceProvider, obj, obj> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function KeyedSingleton (serviceType As Type, serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, Object)) As ServiceDescriptor
パラメーター
- serviceType
- Type
サービスの種類。
- serviceKey
- Object
サービスの ServiceKey 。
- implementationFactory
- Func<IServiceProvider,Object,Object>
サービス実装の新しいインスタンスを作成するファクトリ。
返品
ServiceDescriptorの新しいインスタンス。
適用対象
KeyedSingleton(Type, Object, Object)
指定したserviceType、implementationInstance、およびSingletonの有効期間を使用して、ServiceDescriptorのインスタンスを作成します。
public:
static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(Type ^ serviceType, System::Object ^ serviceKey, System::Object ^ implementationInstance);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton(Type serviceType, object? serviceKey, object implementationInstance);
static member KeyedSingleton : Type * obj * obj -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function KeyedSingleton (serviceType As Type, serviceKey As Object, implementationInstance As Object) As ServiceDescriptor
パラメーター
- serviceType
- Type
サービスの種類。
- serviceKey
- Object
サービスの ServiceKey 。
- implementationInstance
- Object
実装のインスタンス。
返品
ServiceDescriptorの新しいインスタンス。
適用対象
KeyedSingleton(Type, Object, Type)
指定したserviceとimplementationTypeとSingletonの有効期間を使用して、ServiceDescriptorのインスタンスを作成します。
public:
static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(Type ^ service, System::Object ^ serviceKey, Type ^ implementationType);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton(Type service, object? serviceKey, Type implementationType);
static member KeyedSingleton : Type * obj * Type -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function KeyedSingleton (service As Type, serviceKey As Object, implementationType As Type) As ServiceDescriptor
パラメーター
- service
- Type
サービスの種類。
- serviceKey
- Object
サービスの ServiceKey 。
- implementationType
- Type
実装の型。
返品
ServiceDescriptorの新しいインスタンス。
適用対象
KeyedSingleton<TService,TImplementation>(Object, Func<IServiceProvider,Object,TImplementation>)
指定したTService、TImplementation、implementationFactory、およびSingleton有効期間を使用して、ServiceDescriptorのインスタンスを作成します。
public:
generic <typename TService, typename TImplementation>
where TService : class where TImplementation : class, TService static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, TImplementation> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService,TImplementation>(object? serviceKey, Func<IServiceProvider,object?,TImplementation> implementationFactory) where TService : class where TImplementation : class, TService;
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService,TImplementation>(object? serviceKey, Func<IServiceProvider,object,TImplementation> implementationFactory) where TService : class where TImplementation : class, TService;
static member KeyedSingleton : obj * Func<IServiceProvider, obj, #'Service> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function KeyedSingleton(Of TService As Class, TImplementation As Class) (serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, TImplementation)) As ServiceDescriptor
型パラメーター
- TService
サービスの種類。
- TImplementation
実装の型。
パラメーター
- serviceKey
- Object
サービスの ServiceKey 。
- implementationFactory
- Func<IServiceProvider,Object,TImplementation>
サービス実装の新しいインスタンスを作成するファクトリ。
返品
ServiceDescriptorの新しいインスタンス。
適用対象
KeyedSingleton<TService,TImplementation>(Object)
指定したTService、TImplementation、およびSingletonの有効期間を使用して、ServiceDescriptorのインスタンスを作成します。
public:
generic <typename TService, typename TImplementation>
where TService : class where TImplementation : class, TService static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(System::Object ^ serviceKey);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService,TImplementation>(object? serviceKey) where TService : class where TImplementation : class, TService;
static member KeyedSingleton : obj -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function KeyedSingleton(Of TService As Class, TImplementation As Class) (serviceKey As Object) As ServiceDescriptor
型パラメーター
- TService
サービスの種類。
- TImplementation
実装の型。
パラメーター
- serviceKey
- Object
サービスの ServiceKey 。
返品
ServiceDescriptorの新しいインスタンス。
適用対象
KeyedSingleton<TService>(Object, Func<IServiceProvider,Object,TService>)
指定したTService、implementationFactory、およびSingletonの有効期間を使用して、ServiceDescriptorのインスタンスを作成します。
public:
generic <typename TService>
where TService : class static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, TService> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService>(object? serviceKey, Func<IServiceProvider,object?,TService> implementationFactory) where TService : class;
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService>(object? serviceKey, Func<IServiceProvider,object,TService> implementationFactory) where TService : class;
static member KeyedSingleton : obj * Func<IServiceProvider, obj, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function KeyedSingleton(Of TService As Class) (serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, TService)) As ServiceDescriptor
型パラメーター
- TService
サービスの種類。
パラメーター
- serviceKey
- Object
サービスの ServiceKey 。
- implementationFactory
- Func<IServiceProvider,Object,TService>
サービス実装の新しいインスタンスを作成するファクトリ。
返品
ServiceDescriptorの新しいインスタンス。
適用対象
KeyedSingleton<TService>(Object, TService)
指定したTService、implementationInstance、およびSingletonの有効期間を使用して、ServiceDescriptorのインスタンスを作成します。
public:
generic <typename TService>
where TService : class static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(System::Object ^ serviceKey, TService implementationInstance);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService>(object? serviceKey, TService implementationInstance) where TService : class;
static member KeyedSingleton : obj * 'Service -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function KeyedSingleton(Of TService As Class) (serviceKey As Object, implementationInstance As TService) As ServiceDescriptor
型パラメーター
- TService
サービスの種類。
パラメーター
- serviceKey
- Object
サービスの ServiceKey 。
- implementationInstance
- TService
実装のインスタンス。
返品
ServiceDescriptorの新しいインスタンス。