Aracılığıyla paylaş


ServiceCollectionDescriptorExtensions.TryAddKeyedSingleton Yöntem

Tanım

Aşırı Yüklemeler

TryAddKeyedSingleton(IServiceCollection, Type, Object)

Hizmet collection türü henüz kaydedilmemişse belirtilen service hizmet olarak Singleton öğesini öğesine ekler.

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

service Hizmet türü henüz kaydedilmemişse, içinde implementationFactory belirtilen fabrikayı collection kullanarak belirtileni bir hizmet olarak Singleton ekler.

TryAddKeyedSingleton(IServiceCollection, Type, Object, Type)

Hizmet türü henüz kaydedilmemişse, uygulamasıyla collectionimplementationType belirtilen hizmet olarak Singleton değerini service öğesine ekler.

TryAddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

Belirtilen TServiceSingleton hizmet türü önceden kaydedilmemişse içinde belirtilen TImplementationcollection hizmet uygulama türünü öğesine ekler.

TryAddKeyedSingleton<TService>(IServiceCollection, Object)

Hizmet collection türü henüz kaydedilmemişse belirtilen TService hizmet olarak Singleton öğesini öğesine ekler.

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

TService Hizmet türü henüz kaydedilmemişse, içinde implementationFactory belirtilen fabrikayı services kullanarak belirtileni bir hizmet olarak Singleton ekler.

TryAddKeyedSingleton<TService>(IServiceCollection, Object, TService)

Hizmet TService türü henüz kaydedilmemişse belirtilen öğesini içinde belirtilen instancecollection bir örneğiyle bir hizmet olarak Singleton ekler.

TryAddKeyedSingleton(IServiceCollection, Type, Object)

Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs

Hizmet collection türü henüz kaydedilmemişse belirtilen service hizmet olarak Singleton öğesini öğesine ekler.

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

Parametreler

service
Type

Kaydedilecek hizmetin türü.

serviceKey
Object

Hizmet anahtarı.

Şunlara uygulanır

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

Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs

service Hizmet türü henüz kaydedilmemişse, içinde implementationFactory belirtilen fabrikayı collection kullanarak belirtileni bir hizmet olarak Singleton ekler.

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

Parametreler

service
Type

Kaydedilecek hizmetin türü.

serviceKey
Object

Hizmet anahtarı.

implementationFactory
Func<IServiceProvider,Object,Object>

Hizmeti oluşturan fabrika.

Şunlara uygulanır

TryAddKeyedSingleton(IServiceCollection, Type, Object, Type)

Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs

Hizmet türü henüz kaydedilmemişse, uygulamasıyla collectionimplementationType belirtilen hizmet olarak Singleton değerini service öğesine ekler.

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

Parametreler

service
Type

Kaydedilecek hizmetin türü.

serviceKey
Object

Hizmet anahtarı.

implementationType
Type

Hizmetin uygulama türü.

Şunlara uygulanır

TryAddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs

Belirtilen TServiceSingleton hizmet türü önceden kaydedilmemişse içinde belirtilen TImplementationcollection hizmet uygulama türünü öğesine ekler.

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

Tür Parametreleri

TService

Eklenecek hizmetin türü.

TImplementation

Kullanılacak uygulamanın türü.

Parametreler

serviceKey
Object

Hizmet anahtarı.

Şunlara uygulanır

TryAddKeyedSingleton<TService>(IServiceCollection, Object)

Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs

Hizmet collection türü henüz kaydedilmemişse belirtilen TService hizmet olarak Singleton öğesini öğesine ekler.

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

Tür Parametreleri

TService

Eklenecek hizmetin türü.

Parametreler

serviceKey
Object

Hizmet anahtarı.

Şunlara uygulanır

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

Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs

TService Hizmet türü henüz kaydedilmemişse, içinde implementationFactory belirtilen fabrikayı services kullanarak belirtileni bir hizmet olarak Singleton ekler.

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

Tür Parametreleri

TService

Eklenecek hizmetin türü.

Parametreler

serviceKey
Object

Hizmet anahtarı.

implementationFactory
Func<IServiceProvider,Object,TService>

Hizmeti oluşturan fabrika.

Şunlara uygulanır

TryAddKeyedSingleton<TService>(IServiceCollection, Object, TService)

Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs
Kaynak:
ServiceCollectionDescriptorExtensions.Keyed.cs

Hizmet TService türü henüz kaydedilmemişse belirtilen öğesini içinde belirtilen instancecollection bir örneğiyle bir hizmet olarak Singleton ekler.

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

Tür Parametreleri

TService

Eklenecek hizmetin türü.

Parametreler

serviceKey
Object

Hizmet anahtarı.

instance
TService

Eklenecek hizmetin örneği.

Şunlara uygulanır