Bagikan melalui


ServiceDescriptor.KeyedSingleton Metode

Definisi

Overload

KeyedSingleton(Type, Object, Func<IServiceProvider,Object,Object>)

Membuat instans ServiceDescriptor dengan , , implementationFactorydan Singleton masa pakai yang ditentukanserviceType.

KeyedSingleton(Type, Object, Object)

Membuat instans ServiceDescriptor dengan , , implementationInstancedan Singleton masa pakai yang ditentukanserviceType.

KeyedSingleton(Type, Object, Type)

Membuat instans ServiceDescriptor dengan yang ditentukan service dan implementationType dan masa pakainya Singleton .

KeyedSingleton<TService,TImplementation>(Object, Func<IServiceProvider,Object,TImplementation>)

Membuat instans ServiceDescriptor dengan , , TImplementation, implementationFactorydan Singleton masa pakai yang ditentukanTService.

KeyedSingleton<TService,TImplementation>(Object)

Membuat instans ServiceDescriptor dengan , , TImplementationdan Singleton masa pakai yang ditentukanTService.

KeyedSingleton<TService>(Object, Func<IServiceProvider,Object,TService>)

Membuat instans ServiceDescriptor dengan , , implementationFactorydan Singleton masa pakai yang ditentukanTService.

KeyedSingleton<TService>(Object, TService)

Membuat instans ServiceDescriptor dengan , , implementationInstancedan Singleton masa pakai yang ditentukanTService.

KeyedSingleton(Type, Object, Func<IServiceProvider,Object,Object>)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , implementationFactorydan Singleton masa pakai yang ditentukanserviceType.

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);
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

Parameter

serviceType
Type

Jenis layanan.

serviceKey
Object

Dari ServiceKey layanan.

implementationFactory
Func<IServiceProvider,Object,Object>

Pabrik untuk membuat instans baru implementasi layanan.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

KeyedSingleton(Type, Object, Object)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , implementationInstancedan Singleton masa pakai yang ditentukanserviceType.

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

Parameter

serviceType
Type

Jenis layanan.

serviceKey
Object

Dari ServiceKey layanan.

implementationInstance
Object

Instans implementasi.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

KeyedSingleton(Type, Object, Type)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan yang ditentukan service dan implementationType dan masa pakainya Singleton .

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

Parameter

service
Type

Jenis layanan.

serviceKey
Object

Dari ServiceKey layanan.

implementationType
Type

Jenis implementasi.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

KeyedSingleton<TService,TImplementation>(Object, Func<IServiceProvider,Object,TImplementation>)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , TImplementation, implementationFactorydan Singleton masa pakai yang ditentukanTService.

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;
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

Jenis parameter

TService

Jenis layanan.

TImplementation

Jenis implementasi.

Parameter

serviceKey
Object

Dari ServiceKey layanan.

implementationFactory
Func<IServiceProvider,Object,TImplementation>

Pabrik untuk membuat instans baru implementasi layanan.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

KeyedSingleton<TService,TImplementation>(Object)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , TImplementationdan Singleton masa pakai yang ditentukanTService.

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

Jenis parameter

TService

Jenis layanan.

TImplementation

Jenis implementasi.

Parameter

serviceKey
Object

Dari ServiceKey layanan.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

KeyedSingleton<TService>(Object, Func<IServiceProvider,Object,TService>)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , implementationFactorydan Singleton masa pakai yang ditentukanTService.

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;
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

Jenis parameter

TService

Jenis layanan.

Parameter

serviceKey
Object

Dari ServiceKey layanan.

implementationFactory
Func<IServiceProvider,Object,TService>

Pabrik untuk membuat instans baru implementasi layanan.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

KeyedSingleton<TService>(Object, TService)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , implementationInstancedan Singleton masa pakai yang ditentukanTService.

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

Jenis parameter

TService

Jenis layanan.

Parameter

serviceKey
Object

Dari ServiceKey layanan.

implementationInstance
TService

Instans implementasi.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk