Bagikan melalui


AutoActivationExtensions.AddActivatedSingleton Metode

Definisi

Overload

AddActivatedSingleton(IServiceCollection, Type)

Menambahkan layanan singleton yang diaktifkan secara otomatis dari jenis yang ditentukan dalam serviceType ke yang ditentukan IServiceCollection.

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

Menambahkan layanan singleton yang diaktifkan secara otomatis.

AddActivatedSingleton(IServiceCollection, Type, Type)

Menambahkan layanan singleton yang diaktifkan secara otomatis.

AddActivatedSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

Menambahkan layanan singleton yang diaktifkan secara otomatis.

AddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Menambahkan layanan singleton yang diaktifkan secara otomatis.

AddActivatedSingleton<TService>(IServiceCollection)

Menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Menambahkan layanan singleton yang diaktifkan secara otomatis.

AddActivatedSingleton(IServiceCollection, Type)

Sumber:
AutoActivationExtensions.cs
Sumber:
AutoActivationExtensions.cs

Menambahkan layanan singleton yang diaktifkan secara otomatis dari jenis yang ditentukan dalam serviceType ke yang ditentukan IServiceCollection.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan untuk mendaftar dan implementasi yang akan digunakan.

Mengembalikan

Nilai dari services.

Berlaku untuk

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

Sumber:
AutoActivationExtensions.cs
Sumber:
AutoActivationExtensions.cs

Menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

implementationFactory
Func<IServiceProvider,Object>

Pabrik yang membuat layanan.

Mengembalikan

Nilai dari services.

Berlaku untuk

AddActivatedSingleton(IServiceCollection, Type, Type)

Sumber:
AutoActivationExtensions.cs
Sumber:
AutoActivationExtensions.cs

Menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

implementationType
Type

Jenis implementasi layanan.

Mengembalikan

Nilai dari services.

Berlaku untuk

AddActivatedSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

Sumber:
AutoActivationExtensions.cs
Sumber:
AutoActivationExtensions.cs

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 Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddActivatedSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<IServiceProvider ^, TImplementation> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddActivatedSingleton<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<IServiceProvider,TImplementation> implementationFactory) where TService : class where TImplementation : class, TService;
static member AddActivatedSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, #'Service> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddActivatedSingleton(Of TService As Class, TImplementation As Class) (services As IServiceCollection, implementationFactory As Func(Of IServiceProvider, TImplementation)) As IServiceCollection

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

TImplementation

Jenis implementasi yang akan digunakan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

implementationFactory
Func<IServiceProvider,TImplementation>

Pabrik yang membuat layanan.

Mengembalikan

Nilai dari services.

Berlaku untuk

AddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Sumber:
AutoActivationExtensions.cs
Sumber:
AutoActivationExtensions.cs

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 Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddActivatedSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddActivatedSingleton<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TService : class where TImplementation : class, TService;
static member AddActivatedSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddActivatedSingleton(Of TService As Class, TImplementation As Class) (services As IServiceCollection) As IServiceCollection

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

TImplementation

Jenis implementasi yang akan digunakan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

Mengembalikan

Nilai dari services.

Berlaku untuk

AddActivatedSingleton<TService>(IServiceCollection)

Sumber:
AutoActivationExtensions.cs
Sumber:
AutoActivationExtensions.cs

Menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

Mengembalikan

Nilai dari services.

Berlaku untuk

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

Sumber:
AutoActivationExtensions.cs
Sumber:
AutoActivationExtensions.cs

Menambahkan layanan singleton yang diaktifkan secara otomatis.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

services
IServiceCollection

Kumpulan layanan untuk menambahkan layanan.

implementationFactory
Func<IServiceProvider,TService>

Pabrik yang membuat layanan.

Mengembalikan

Nilai dari services.

Berlaku untuk