Bagikan melalui


AutoActivationExtensions.TryAddActivatedSingleton Metode

Definisi

Overload

TryAddActivatedSingleton(IServiceCollection, Type)

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

TryAddActivatedSingleton(IServiceCollection, Type, Type)

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

TryAddActivatedSingleton<TService>(IServiceCollection)

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

TryAddActivatedSingleton(IServiceCollection, Type)

Sumber:
AutoActivationExtensions.cs

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

Berlaku untuk

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

Sumber:
AutoActivationExtensions.cs

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

implementationFactory
Func<IServiceProvider,Object>

Pabrik yang membuat layanan.

Berlaku untuk

TryAddActivatedSingleton(IServiceCollection, Type, Type)

Sumber:
AutoActivationExtensions.cs

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

implementationType
Type

Jenis implementasi layanan.

Berlaku untuk

TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Sumber:
AutoActivationExtensions.cs

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

TImplementation

Jenis implementasi yang akan digunakan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

Berlaku untuk

TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

Sumber:
AutoActivationExtensions.cs

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

implementationFactory
Func<IServiceProvider,TService>

Pabrik yang membuat layanan.

Berlaku untuk

TryAddActivatedSingleton<TService>(IServiceCollection)

Sumber:
AutoActivationExtensions.cs

Mencoba menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

Berlaku untuk