Bagikan melalui


AutoActivationExtensions.TryAddActivatedKeyedSingleton Metode

Definisi

Overload

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object)

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

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

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object, Type)

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

TryAddActivatedKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

TryAddActivatedKeyedSingleton<TService>(IServiceCollection, Object)

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

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

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object)

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

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Objek yang digunakan untuk mengidentifikasi layanan tertentu secara unik.

Berlaku untuk

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

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

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Objek yang digunakan untuk mengidentifikasi layanan tertentu secara unik.

implementationFactory
Func<IServiceProvider,Object,Object>

Pabrik yang membuat layanan.

Berlaku untuk

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object, Type)

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

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Objek yang digunakan untuk mengidentifikasi layanan tertentu secara unik.

implementationType
Type

Jenis implementasi layanan.

Berlaku untuk

TryAddActivatedKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

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

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

TImplementation

Jenis implementasi yang akan digunakan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceKey
Object

Objek yang digunakan untuk mengidentifikasi layanan tertentu secara unik.

Berlaku untuk

TryAddActivatedKeyedSingleton<TService>(IServiceCollection, Object)

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

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceKey
Object

Objek yang digunakan untuk mengidentifikasi layanan tertentu secara unik.

Berlaku untuk

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

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

Mencoba menambahkan layanan singleton bertanda kunci yang diaktifkan secara otomatis.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceKey
Object

Objek yang digunakan untuk mengidentifikasi layanan tertentu secara unik.

implementationFactory
Func<IServiceProvider,Object,TService>

Pabrik yang membuat layanan.

Berlaku untuk