Partager via


AutoActivationExtensions.TryAddActivatedSingleton Méthode

Définition

Surcharges

TryAddActivatedSingleton(IServiceCollection, Type)

Tente d’ajouter un service singleton activé automatiquement.

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

Tente d’ajouter un service singleton activé automatiquement.

TryAddActivatedSingleton(IServiceCollection, Type, Type)

Tente d’ajouter un service singleton activé automatiquement.

TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Tente d’ajouter un service singleton activé automatiquement.

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

Tente d’ajouter un service singleton activé automatiquement.

TryAddActivatedSingleton<TService>(IServiceCollection)

Tente d’ajouter un service singleton activé automatiquement.

TryAddActivatedSingleton(IServiceCollection, Type)

Source:
AutoActivationExtensions.cs

Tente d’ajouter un service singleton activé automatiquement.

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)

Paramètres

services
IServiceCollection

Collection de services à laquelle ajouter le service.

serviceType
Type

Type de service à inscrire.

S’applique à

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

Source:
AutoActivationExtensions.cs

Tente d’ajouter un service singleton activé automatiquement.

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))

Paramètres

services
IServiceCollection

Collection de services à laquelle ajouter le service.

serviceType
Type

Type de service à inscrire.

implementationFactory
Func<IServiceProvider,Object>

Fabrique qui crée le service.

S’applique à

TryAddActivatedSingleton(IServiceCollection, Type, Type)

Source:
AutoActivationExtensions.cs

Tente d’ajouter un service singleton activé automatiquement.

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)

Paramètres

services
IServiceCollection

Collection de services à laquelle ajouter le service.

serviceType
Type

Type de service à inscrire.

implementationType
Type

Type d’implémentation du service.

S’applique à

TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Source:
AutoActivationExtensions.cs

Tente d’ajouter un service singleton activé automatiquement.

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)

Paramètres de type

TService

Le type de service à ajouter.

TImplementation

Type de l’implémentation à utiliser.

Paramètres

services
IServiceCollection

Collection de services à laquelle ajouter le service.

S’applique à

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

Source:
AutoActivationExtensions.cs

Tente d’ajouter un service singleton activé automatiquement.

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))

Paramètres de type

TService

Le type de service à ajouter.

Paramètres

services
IServiceCollection

Collection de services à laquelle ajouter le service.

implementationFactory
Func<IServiceProvider,TService>

Fabrique qui crée le service.

S’applique à

TryAddActivatedSingleton<TService>(IServiceCollection)

Source:
AutoActivationExtensions.cs

Tente d’ajouter un service singleton activé automatiquement.

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)

Paramètres de type

TService

Le type de service à ajouter.

Paramètres

services
IServiceCollection

Collection de services à laquelle ajouter le service.

S’applique à