Sdílet prostřednictvím


AutoActivationExtensions.TryAddActivatedSingleton Metoda

Definice

Přetížení

TryAddActivatedSingleton(IServiceCollection, Type)

Pokusí se přidat automaticky aktivovanou službu singleton.

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

Pokusí se přidat automaticky aktivovanou službu singleton.

TryAddActivatedSingleton(IServiceCollection, Type, Type)

Pokusí se přidat automaticky aktivovanou službu singleton.

TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Pokusí se přidat automaticky aktivovanou službu singleton.

TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

Pokusí se přidat automaticky aktivovanou službu singleton.

TryAddActivatedSingleton<TService>(IServiceCollection)

Pokusí se přidat automaticky aktivovanou službu singleton.

TryAddActivatedSingleton(IServiceCollection, Type)

Zdroj:
AutoActivationExtensions.cs

Pokusí se přidat automaticky aktivovanou službu singleton.

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

Parametry

services
IServiceCollection

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

serviceType
Type

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

Platí pro

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

Zdroj:
AutoActivationExtensions.cs

Pokusí se přidat automaticky aktivovanou službu singleton.

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

Parametry

services
IServiceCollection

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

serviceType
Type

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

implementationFactory
Func<IServiceProvider,Object>

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

Platí pro

TryAddActivatedSingleton(IServiceCollection, Type, Type)

Zdroj:
AutoActivationExtensions.cs

Pokusí se přidat automaticky aktivovanou službu singleton.

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddActivatedSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, Type ^ implementationType);
public static void TryAddActivatedSingleton (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, Type implementationType);
static member TryAddActivatedSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Type -> unit
<Extension()>
Public Sub TryAddActivatedSingleton (services As IServiceCollection, serviceType As Type, 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.

implementationType
Type

Typ implementace služby.

Platí pro

TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Zdroj:
AutoActivationExtensions.cs

Pokusí se přidat automaticky aktivovanou službu singleton.

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

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.

Platí pro

TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

Zdroj:
AutoActivationExtensions.cs

Pokusí se přidat automaticky aktivovanou službu singleton.

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

implementationFactory
Func<IServiceProvider,TService>

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

Platí pro

TryAddActivatedSingleton<TService>(IServiceCollection)

Zdroj:
AutoActivationExtensions.cs

Pokusí se přidat automaticky aktivovanou službu singleton.

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

Parametry typu

TService

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

Parametry

services
IServiceCollection

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

Platí pro