AutoActivationExtensions.TryAddActivatedSingleton Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Sobrecargas
TryAddActivatedSingleton(IServiceCollection, Type) |
Intenta agregar un servicio singleton activado automáticamente. |
TryAddActivatedSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>) |
Intenta agregar un servicio singleton activado automáticamente. |
TryAddActivatedSingleton(IServiceCollection, Type, Type) |
Intenta agregar un servicio singleton activado automáticamente. |
TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection) |
Intenta agregar un servicio singleton activado automáticamente. |
TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>) |
Intenta agregar un servicio singleton activado automáticamente. |
TryAddActivatedSingleton<TService>(IServiceCollection) |
Intenta agregar un servicio singleton activado automáticamente. |
TryAddActivatedSingleton(IServiceCollection, Type)
- Source:
- AutoActivationExtensions.cs
- Source:
- AutoActivationExtensions.cs
Intenta agregar un servicio singleton activado automáticamente.
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
Colección de servicios a la que se va a agregar el servicio.
- serviceType
- Type
El tipo de servicio que se va a registrar.
Se aplica a
TryAddActivatedSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)
- Source:
- AutoActivationExtensions.cs
- Source:
- AutoActivationExtensions.cs
Intenta agregar un servicio singleton activado automáticamente.
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
Colección de servicios a la que se va a agregar el servicio.
- serviceType
- Type
El tipo de servicio que se va a registrar.
- implementationFactory
- Func<IServiceProvider,Object>
El generador que crea el servicio.
Se aplica a
TryAddActivatedSingleton(IServiceCollection, Type, Type)
- Source:
- AutoActivationExtensions.cs
- Source:
- AutoActivationExtensions.cs
Intenta agregar un servicio singleton activado automáticamente.
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
Colección de servicios a la que se va a agregar el servicio.
- serviceType
- Type
El tipo de servicio que se va a registrar.
- implementationType
- Type
El tipo de implementación del servicio.
Se aplica a
TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)
- Source:
- AutoActivationExtensions.cs
- Source:
- AutoActivationExtensions.cs
Intenta agregar un servicio singleton activado automáticamente.
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
El tipo del servicio que se debe agregar.
- TImplementation
Tipo de la implementación que se va a usar.
Parámetros
- services
- IServiceCollection
Colección de servicios a la que se va a agregar el servicio.
Se aplica a
TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)
- Source:
- AutoActivationExtensions.cs
- Source:
- AutoActivationExtensions.cs
Intenta agregar un servicio singleton activado automáticamente.
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
El tipo del servicio que se debe agregar.
Parámetros
- services
- IServiceCollection
Colección de servicios a la que se va a agregar el servicio.
- implementationFactory
- Func<IServiceProvider,TService>
El generador que crea el servicio.
Se aplica a
TryAddActivatedSingleton<TService>(IServiceCollection)
- Source:
- AutoActivationExtensions.cs
- Source:
- AutoActivationExtensions.cs
Intenta agregar un servicio singleton activado automáticamente.
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
El tipo del servicio que se debe agregar.
Parámetros
- services
- IServiceCollection
Colección de servicios a la que se va a agregar el servicio.