Bagikan melalui


ServiceCollectionDescriptorExtensions.TryAddKeyedScoped Metode

Definisi

Overload

TryAddKeyedScoped(IServiceCollection, Type, Object, Type)

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

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

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

TryAddKeyedScoped(IServiceCollection, Type, Object)

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

TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

Menambahkan yang ditentukan TService sebagai jenis implementasi layanan yang Scoped ditentukan dalam TImplementation jika collection jenis layanan belum terdaftar.

TryAddKeyedScoped<TService>(IServiceCollection, Object)

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

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

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

TryAddKeyedScoped(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 Scoped layanan dengan implementationType implementasi ke collection jika jenis layanan belum terdaftar.

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

TryAddKeyedScoped(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 Scoped layanan menggunakan pabrik yang ditentukan ke implementationFactorycollection jika jenis layanan belum terdaftar.

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

TryAddKeyedScoped(IServiceCollection, Type, Object)

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

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

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

Parameter

service
Type

Jenis layanan yang akan didaftarkan.

serviceKey
Object

Kunci layanan.

Berlaku untuk

TryAddKeyedScoped<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 Scoped ditentukan dalam TImplementation jika collection jenis layanan belum terdaftar.

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

TryAddKeyedScoped<TService>(IServiceCollection, Object)

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

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

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

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