ServiceCollectionServiceExtensions.AddKeyedScoped Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Overload
AddKeyedScoped(IServiceCollection, Type, Object) |
Menambahkan layanan terlingkup dari jenis yang ditentukan ke |
AddKeyedScoped(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>) |
Menambahkan layanan terlingkup dari jenis yang ditentukan di |
AddKeyedScoped(IServiceCollection, Type, Object, Type) |
Menambahkan layanan terlingkup dari jenis yang ditentukan dalam |
AddKeyedScoped<TService,TImplementation>(IServiceCollection, Object) |
Menambahkan layanan terlingkup dari jenis yang ditentukan dalam |
AddKeyedScoped<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>) |
Menambahkan layanan terlingkup dari jenis yang ditentukan dalam |
AddKeyedScoped<TService>(IServiceCollection, Object) |
Menambahkan layanan terlingkup dari jenis yang ditentukan ke |
AddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>) |
Menambahkan layanan terlingkup dari jenis yang ditentukan di |
AddKeyedScoped(IServiceCollection, Type, Object)
Menambahkan layanan terlingkup dari jenis yang ditentukan ke serviceType
yang ditentukan IServiceCollection.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, System::Object ^ serviceKey);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddKeyedScoped (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, object? serviceKey);
static member AddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * obj -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddKeyedScoped (services As IServiceCollection, serviceType As Type, serviceKey As Object) As IServiceCollection
Parameter
- services
- IServiceCollection
untuk IServiceCollection menambahkan layanan.
- serviceType
- Type
Jenis layanan untuk mendaftar dan implementasi yang akan digunakan.
- serviceKey
- Object
Dari ServiceKey layanan.
Mengembalikan
Referensi ke instans ini setelah operasi selesai.
Lihat juga
Berlaku untuk
AddKeyedScoped(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>)
Menambahkan layanan terlingkup dari jenis yang ditentukan di serviceType
dengan pabrik yang ditentukan ke implementationFactory
IServiceCollection.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, System::Object ^> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddKeyedScoped (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, object? serviceKey, Func<IServiceProvider,object?,object> implementationFactory);
static member AddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * obj * Func<IServiceProvider, obj, obj> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddKeyedScoped (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
Dari ServiceKey layanan.
- implementationFactory
- Func<IServiceProvider,Object,Object>
Pabrik yang membuat layanan.
Mengembalikan
Referensi ke instans ini setelah operasi selesai.
Lihat juga
Berlaku untuk
AddKeyedScoped(IServiceCollection, Type, Object, Type)
Menambahkan layanan terlingkup dari jenis yang ditentukan dalam serviceType
dengan implementasi jenis yang ditentukan dalam implementationType
ke yang ditentukan IServiceCollection.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, System::Object ^ serviceKey, Type ^ implementationType);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddKeyedScoped (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, object? serviceKey, Type implementationType);
static member AddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * obj * Type -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddKeyedScoped (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
Dari ServiceKey layanan.
- implementationType
- Type
Jenis implementasi layanan.
Mengembalikan
Referensi ke instans ini setelah operasi selesai.
Lihat juga
Berlaku untuk
AddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)
Menambahkan layanan terlingkup dari jenis yang ditentukan dalam TService
dengan jenis implementasi yang ditentukan dalam TImplementation
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 ^ AddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::Object ^ serviceKey);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddKeyedScoped<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, object? serviceKey) where TService : class where TImplementation : class, TService;
static member AddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddKeyedScoped(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
Dari ServiceKey layanan.
Mengembalikan
Referensi ke instans ini setelah operasi selesai.
Lihat juga
Berlaku untuk
AddKeyedScoped<TService,TImplementation>(IServiceCollection, Object, Func<IServiceProvider,Object,TImplementation>)
Menambahkan layanan terlingkup dari jenis yang ditentukan dalam TService
dengan 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 ^ AddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, TImplementation> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddKeyedScoped<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, object? serviceKey, Func<IServiceProvider,object?,TImplementation> implementationFactory) where TService : class where TImplementation : class, TService;
static member AddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Func<IServiceProvider, obj, #'Service> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddKeyedScoped(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
Dari ServiceKey layanan.
- implementationFactory
- Func<IServiceProvider,Object,TImplementation>
Pabrik yang membuat layanan.
Mengembalikan
Referensi ke instans ini setelah operasi selesai.
Lihat juga
Berlaku untuk
AddKeyedScoped<TService>(IServiceCollection, Object)
Menambahkan layanan terlingkup 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 ^ AddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::Object ^ serviceKey);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddKeyedScoped<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, object? serviceKey) where TService : class;
static member AddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddKeyedScoped(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
Dari ServiceKey layanan.
Mengembalikan
Referensi ke instans ini setelah operasi selesai.
Lihat juga
Berlaku untuk
AddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)
Menambahkan layanan terlingkup dari jenis yang ditentukan di TService
dengan pabrik yang ditentukan ke implementationFactory
IServiceCollection.
public:
generic <typename TService>
where TService : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddKeyedScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, TService> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddKeyedScoped<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, object? serviceKey, Func<IServiceProvider,object?,TService> implementationFactory) where TService : class;
static member AddKeyedScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Func<IServiceProvider, obj, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddKeyedScoped(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
Dari ServiceKey layanan.
- implementationFactory
- Func<IServiceProvider,Object,TService>
Pabrik yang membuat layanan.
Mengembalikan
Referensi ke instans ini setelah operasi selesai.