Bagikan melalui


ServiceCollectionDescriptorExtensions.TryAddKeyedTransient Metode

Definisi

Overload

TryAddKeyedTransient(IServiceCollection, Type, Object, Type)

Menambahkan yang ditentukan service sebagai Transient layanan dengan implementationType implementasi ke collection jika jenis layanan belum terdaftar.

TryAddKeyedTransient(IServiceCollection, Type, Object)

Menambahkan yang ditentukan service sebagai Transient layanan ke collection jika jenis layanan belum terdaftar.

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

Menambahkan yang ditentukan service sebagai Transient layanan menggunakan pabrik yang ditentukan ke implementationFactorycollection jika jenis layanan belum terdaftar.

TryAddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

Menambahkan yang ditentukan TService sebagai jenis implementasi layanan yang Transient ditentukan ke TImplementationcollection jika jenis layanan belum terdaftar.

TryAddKeyedTransient<TService>(IServiceCollection, Object)

Menambahkan yang ditentukan TService sebagai Transient layanan ke collection jika jenis layanan belum terdaftar.

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

Menambahkan yang ditentukan TService sebagai Transient layanan menggunakan pabrik yang ditentukan ke implementationFactoryservices jika jenis layanan belum terdaftar.

TryAddKeyedTransient(IServiceCollection, Type, Object, Type)

Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs

Menambahkan yang ditentukan service sebagai Transient layanan dengan implementationType implementasi ke collection jika jenis layanan belum terdaftar.

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

Parameter

service
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Kunci layanan.

implementationType
Type

Jenis implementasi layanan.

Berlaku untuk

TryAddKeyedTransient(IServiceCollection, Type, Object)

Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs

Menambahkan yang ditentukan service sebagai Transient layanan ke collection jika jenis layanan belum terdaftar.

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

Parameter

service
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Kunci layanan.

Berlaku untuk

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

Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs

Menambahkan yang ditentukan service sebagai Transient layanan menggunakan pabrik yang ditentukan ke implementationFactorycollection jika jenis layanan belum terdaftar.

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

Parameter

service
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Kunci layanan.

implementationFactory
Func<IServiceProvider,Object,Object>

Pabrik yang membuat layanan.

Berlaku untuk

TryAddKeyedTransient<TService,TImplementation>(IServiceCollection, Object)

Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs

Menambahkan yang ditentukan TService sebagai jenis implementasi layanan yang Transient ditentukan ke TImplementationcollection jika jenis layanan belum terdaftar.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

TImplementation

Jenis implementasi yang akan digunakan.

Parameter

serviceKey
Object

Kunci layanan.

Berlaku untuk

TryAddKeyedTransient<TService>(IServiceCollection, Object)

Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs

Menambahkan yang ditentukan TService sebagai Transient layanan ke collection jika jenis layanan belum terdaftar.

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

Jenis parameter

TService

Jenis layanan yang akan ditambahkan.

Parameter

serviceKey
Object

Kunci layanan.

Berlaku untuk

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

Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs
Sumber:
ServiceCollectionDescriptorExtensions.Keyed.cs

Menambahkan yang ditentukan TService sebagai Transient layanan menggunakan pabrik yang ditentukan ke implementationFactoryservices jika jenis layanan belum terdaftar.

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

serviceKey
Object

Kunci layanan.

implementationFactory
Func<IServiceProvider,Object,TService>

Pabrik yang membuat layanan.

Berlaku untuk