AutoActivationExtensions.TryAddActivatedSingleton Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sobrecargas
TryAddActivatedSingleton(IServiceCollection, Type) |
Tenta adicionar um serviço singleton ativado automaticamente. |
TryAddActivatedSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>) |
Tenta adicionar um serviço singleton ativado automaticamente. |
TryAddActivatedSingleton(IServiceCollection, Type, Type) |
Tenta adicionar um serviço singleton ativado automaticamente. |
TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection) |
Tenta adicionar um serviço singleton ativado automaticamente. |
TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>) |
Tenta adicionar um serviço singleton ativado automaticamente. |
TryAddActivatedSingleton<TService>(IServiceCollection) |
Tenta adicionar um serviço singleton ativado automaticamente. |
TryAddActivatedSingleton(IServiceCollection, Type)
- Origem:
- AutoActivationExtensions.cs
Tenta adicionar um serviço singleton ativado automaticamente.
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)
Parâmetros
- services
- IServiceCollection
A coleção de serviços à qual adicionar o serviço.
- serviceType
- Type
O tipo do serviço a ser registrado.
Aplica-se a
TryAddActivatedSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)
- Origem:
- AutoActivationExtensions.cs
Tenta adicionar um serviço singleton ativado automaticamente.
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))
Parâmetros
- services
- IServiceCollection
A coleção de serviços à qual adicionar o serviço.
- serviceType
- Type
O tipo do serviço a ser registrado.
- implementationFactory
- Func<IServiceProvider,Object>
O alocador que cria o serviço.
Aplica-se a
TryAddActivatedSingleton(IServiceCollection, Type, Type)
- Origem:
- AutoActivationExtensions.cs
Tenta adicionar um serviço singleton ativado automaticamente.
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)
Parâmetros
- services
- IServiceCollection
A coleção de serviços à qual adicionar o serviço.
- serviceType
- Type
O tipo do serviço a ser registrado.
- implementationType
- Type
O tipo de implementação do serviço.
Aplica-se a
TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)
- Origem:
- AutoActivationExtensions.cs
Tenta adicionar um serviço singleton ativado automaticamente.
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)
Parâmetros de tipo
- TService
O tipo do serviço a adicionar.
- TImplementation
O tipo da implementação a ser usada.
Parâmetros
- services
- IServiceCollection
A coleção de serviços à qual adicionar o serviço.
Aplica-se a
TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)
- Origem:
- AutoActivationExtensions.cs
Tenta adicionar um serviço singleton ativado automaticamente.
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))
Parâmetros de tipo
- TService
O tipo do serviço a adicionar.
Parâmetros
- services
- IServiceCollection
A coleção de serviços à qual adicionar o serviço.
- implementationFactory
- Func<IServiceProvider,TService>
O alocador que cria o serviço.
Aplica-se a
TryAddActivatedSingleton<TService>(IServiceCollection)
- Origem:
- AutoActivationExtensions.cs
Tenta adicionar um serviço singleton ativado automaticamente.
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)
Parâmetros de tipo
- TService
O tipo do serviço a adicionar.
Parâmetros
- services
- IServiceCollection
A coleção de serviços à qual adicionar o serviço.