AutoActivationExtensions.TryAddActivatedKeyedSingleton Metoda

Definice

Přetížení

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object)

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

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

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object, Type)

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

TryAddActivatedKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

TryAddActivatedKeyedSingleton<TService>(IServiceCollection, Object)

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

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

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object)

Zdroj:
AutoActivationExtensions.Keyed.cs
Zdroj:
AutoActivationExtensions.Keyed.cs

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

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

Parametry

services
IServiceCollection

Kolekce služby, do které chcete službu přidat.

serviceType
Type

Typ služby, která se má zaregistrovat.

serviceKey
Object

Objekt sloužící k jednoznačné identifikaci konkrétní služby.

Platí pro

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

Zdroj:
AutoActivationExtensions.Keyed.cs
Zdroj:
AutoActivationExtensions.Keyed.cs

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

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

Parametry

services
IServiceCollection

Kolekce služby, do které chcete službu přidat.

serviceType
Type

Typ služby, která se má zaregistrovat.

serviceKey
Object

Objekt sloužící k jednoznačné identifikaci konkrétní služby.

implementationFactory
Func<IServiceProvider,Object,Object>

Továrna, která vytváří službu.

Platí pro

TryAddActivatedKeyedSingleton(IServiceCollection, Type, Object, Type)

Zdroj:
AutoActivationExtensions.Keyed.cs
Zdroj:
AutoActivationExtensions.Keyed.cs

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

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

Parametry

services
IServiceCollection

Kolekce služby, do které chcete službu přidat.

serviceType
Type

Typ služby, která se má zaregistrovat.

serviceKey
Object

Objekt sloužící k jednoznačné identifikaci konkrétní služby.

implementationType
Type

Typ implementace služby.

Platí pro

TryAddActivatedKeyedSingleton<TService,TImplementation>(IServiceCollection, Object)

Zdroj:
AutoActivationExtensions.Keyed.cs
Zdroj:
AutoActivationExtensions.Keyed.cs

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

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

Parametry typu

TService

Typ služby, která se má přidat.

TImplementation

Typ implementace, která se má použít.

Parametry

services
IServiceCollection

Kolekce služby, do které chcete službu přidat.

serviceKey
Object

Objekt sloužící k jednoznačné identifikaci konkrétní služby.

Platí pro

TryAddActivatedKeyedSingleton<TService>(IServiceCollection, Object)

Zdroj:
AutoActivationExtensions.Keyed.cs
Zdroj:
AutoActivationExtensions.Keyed.cs

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

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

Parametry typu

TService

Typ služby, která se má přidat.

Parametry

services
IServiceCollection

Kolekce služby, do které chcete službu přidat.

serviceKey
Object

Objekt sloužící k jednoznačné identifikaci konkrétní služby.

Platí pro

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

Zdroj:
AutoActivationExtensions.Keyed.cs
Zdroj:
AutoActivationExtensions.Keyed.cs

Pokusí se přidat automaticky aktivovanou službu singleton s klíčem.

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

Parametry typu

TService

Typ služby, která se má přidat.

Parametry

services
IServiceCollection

Kolekce služby, do které chcete službu přidat.

serviceKey
Object

Objekt sloužící k jednoznačné identifikaci konkrétní služby.

implementationFactory
Func<IServiceProvider,Object,TService>

Továrna, která vytváří službu.

Platí pro