Bagikan melalui


ServiceCollectionServiceExtensions.AddKeyedTransient Metode

Definisi

Overload

AddKeyedTransient(IServiceCollection, Type, Object, Type)

Menambahkan layanan sementara dari jenis yang ditentukan dengan serviceType implementasi jenis yang ditentukan ke implementationType yang ditentukan IServiceCollection.

AddKeyedTransient(IServiceCollection, Type, Object)

Menambahkan layanan sementara dari jenis yang ditentukan ke serviceType yang ditentukan IServiceCollection.

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

Menambahkan layanan sementara dari jenis yang ditentukan dengan serviceType pabrik yang ditentukan ke implementationFactoryIServiceCollection.

AddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

Menambahkan layanan sementara dari jenis yang ditentukan dengan TService jenis implementasi yang ditentukan ke TImplementation yang ditentukan IServiceCollection.

AddKeyedTransient<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

Menambahkan layanan sementara dari jenis yang ditentukan dengan TService jenis implementasi yang ditentukan dalam TImplementation menggunakan pabrik yang ditentukan dalam implementationFactory ke yang ditentukan IServiceCollection.

AddKeyedTransient<TService>(IServiceCollection, Object)

Menambahkan layanan sementara dari jenis yang ditentukan ke TService yang ditentukan IServiceCollection.

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

Menambahkan layanan sementara dari jenis yang ditentukan dengan TService pabrik yang ditentukan ke implementationFactoryIServiceCollection.

AddKeyedTransient(IServiceCollection, Type, Object, Type)

Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs

Menambahkan layanan sementara dari jenis yang ditentukan dengan serviceType implementasi jenis yang ditentukan ke implementationType yang ditentukan IServiceCollection.

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

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Layanan ServiceKey ini.

implementationType
Type

Jenis implementasi layanan.

Mengembalikan

Referensi ke instans ini setelah operasi selesai.

Lihat juga

Berlaku untuk

AddKeyedTransient(IServiceCollection, Type, Object)

Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs

Menambahkan layanan sementara dari jenis yang ditentukan ke serviceType yang ditentukan IServiceCollection.

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

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan dan implementasi yang akan digunakan.

serviceKey
Object

Layanan ServiceKey ini.

Mengembalikan

Referensi ke instans ini setelah operasi selesai.

Lihat juga

Berlaku untuk

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

Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs

Menambahkan layanan sementara dari jenis yang ditentukan dengan serviceType pabrik yang ditentukan ke implementationFactoryIServiceCollection.

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

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

serviceType
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Layanan ServiceKey ini.

implementationFactory
Func<IServiceProvider,Object,Object>

Pabrik yang membuat layanan.

Mengembalikan

Referensi ke instans ini setelah operasi selesai.

Lihat juga

Berlaku untuk

AddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs

Menambahkan layanan sementara dari jenis yang ditentukan dengan TService jenis implementasi yang ditentukan ke TImplementation yang ditentukan IServiceCollection.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

TImplementation

Jenis implementasi yang akan digunakan.

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

serviceKey
Object

Layanan ServiceKey ini.

Mengembalikan

Referensi ke instans ini setelah operasi selesai.

Lihat juga

Berlaku untuk

AddKeyedTransient<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)

Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs

Menambahkan layanan sementara dari jenis yang ditentukan dengan TService jenis implementasi yang ditentukan dalam TImplementation menggunakan pabrik yang ditentukan dalam implementationFactory ke yang ditentukan IServiceCollection.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

TImplementation

Jenis implementasi yang akan digunakan.

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

serviceKey
Object

Layanan ServiceKey ini.

implementationFactory
Func<IServiceProvider,Object,TImplementation>

Pabrik yang membuat layanan.

Mengembalikan

Referensi ke instans ini setelah operasi selesai.

Lihat juga

Berlaku untuk

AddKeyedTransient<TService>(IServiceCollection, Object)

Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs

Menambahkan layanan sementara dari jenis yang ditentukan ke TService yang ditentukan IServiceCollection.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

serviceKey
Object

Layanan ServiceKey ini.

Mengembalikan

Referensi ke instans ini setelah operasi selesai.

Lihat juga

Berlaku untuk

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

Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs
Sumber:
ServiceCollectionServiceExtensions.Keyed.cs

Menambahkan layanan sementara dari jenis yang ditentukan dengan TService pabrik yang ditentukan ke implementationFactoryIServiceCollection.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

serviceKey
Object

Layanan ServiceKey ini.

implementationFactory
Func<IServiceProvider,Object,TService>

Pabrik yang membuat layanan.

Mengembalikan

Referensi ke instans ini setelah operasi selesai.

Lihat juga

Berlaku untuk