Bagikan melalui


AutoActivationExtensions.ActivateKeyedSingleton Metode

Definisi

Overload

ActivateKeyedSingleton(IServiceCollection, Type, Object)

Memberlakukan aktivasi singleton yang dikunci pada waktu mulai daripada pada waktu proses.

ActivateKeyedSingleton<TService>(IServiceCollection, Object)

Memberlakukan aktivasi singleton yang dikunci pada waktu mulai daripada pada waktu proses.

ActivateKeyedSingleton(IServiceCollection, Type, Object)

Sumber:
AutoActivationExtensions.Keyed.cs
Sumber:
AutoActivationExtensions.Keyed.cs

Memberlakukan aktivasi singleton yang dikunci pada waktu mulai daripada pada waktu proses.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ ActivateKeyedSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, System::Object ^ serviceKey);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection ActivateKeyedSingleton (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, object? serviceKey);
static member ActivateKeyedSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * obj -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function ActivateKeyedSingleton (services As IServiceCollection, serviceType As Type, serviceKey As Object) As IServiceCollection

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan diaktifkan.

serviceKey
Object

Objek yang digunakan untuk mengidentifikasi layanan tertentu secara unik.

Mengembalikan

Nilai dari services.

Berlaku untuk

ActivateKeyedSingleton<TService>(IServiceCollection, Object)

Sumber:
AutoActivationExtensions.Keyed.cs
Sumber:
AutoActivationExtensions.Keyed.cs

Memberlakukan aktivasi singleton yang dikunci pada waktu mulai daripada pada waktu proses.

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

Jenis parameter

TService

Jenis layanan yang akan diaktifkan.

Parameter

services
IServiceCollection

Kumpulan layanan yang berisi layanan.

serviceKey
Object

Objek yang digunakan untuk mengidentifikasi layanan tertentu secara unik.

Mengembalikan

Nilai dari services.

Berlaku untuk