Compartir vía


AutoActivationExtensions.AddActivatedSingleton Método

Definición

Sobrecargas

AddActivatedSingleton(IServiceCollection, Type)

Agrega un servicio singleton activado automáticamente del tipo especificado en serviceType al especificado IServiceCollection.

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

Agrega un servicio singleton activado automáticamente.

AddActivatedSingleton(IServiceCollection, Type, Type)

Agrega un servicio singleton activado automáticamente.

AddActivatedSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

Agrega un servicio singleton activado automáticamente.

AddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Agrega un servicio singleton activado automáticamente.

AddActivatedSingleton<TService>(IServiceCollection)

Agrega un servicio singleton activado automáticamente.

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

Agrega un servicio singleton activado automáticamente.

AddActivatedSingleton(IServiceCollection, Type)

Source:
AutoActivationExtensions.cs
Source:
AutoActivationExtensions.cs

Agrega un servicio singleton activado automáticamente del tipo especificado en serviceType al especificado IServiceCollection.

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

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 y la implementación que se va a usar.

Devoluciones

El valor de services.

Se aplica a

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

Source:
AutoActivationExtensions.cs
Source:
AutoActivationExtensions.cs

Agrega un servicio singleton activado automáticamente.

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

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.

Devoluciones

El valor de services.

Se aplica a

AddActivatedSingleton(IServiceCollection, Type, Type)

Source:
AutoActivationExtensions.cs
Source:
AutoActivationExtensions.cs

Agrega un servicio singleton activado automáticamente.

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

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.

Devoluciones

El valor de services.

Se aplica a

AddActivatedSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

Source:
AutoActivationExtensions.cs
Source:
AutoActivationExtensions.cs

Agrega un servicio singleton activado automáticamente.

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

implementationFactory
Func<IServiceProvider,TImplementation>

El generador que crea el servicio.

Devoluciones

El valor de services.

Se aplica a

AddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Source:
AutoActivationExtensions.cs
Source:
AutoActivationExtensions.cs

Agrega un servicio singleton activado automáticamente.

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddActivatedSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddActivatedSingleton<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TService : class where TImplementation : class, TService;
static member AddActivatedSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddActivatedSingleton(Of TService As Class, TImplementation As Class) (services As IServiceCollection) 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.

Devoluciones

El valor de services.

Se aplica a

AddActivatedSingleton<TService>(IServiceCollection)

Source:
AutoActivationExtensions.cs
Source:
AutoActivationExtensions.cs

Agrega un servicio singleton activado automáticamente.

public:
generic <typename TService>
 where TService : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddActivatedSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddActivatedSingleton<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TService : class;
static member AddActivatedSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddActivatedSingleton(Of TService As Class) (services As IServiceCollection) 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.

Devoluciones

El valor de services.

Se aplica a

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

Source:
AutoActivationExtensions.cs
Source:
AutoActivationExtensions.cs

Agrega un servicio singleton activado automáticamente.

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

implementationFactory
Func<IServiceProvider,TService>

El generador que crea el servicio.

Devoluciones

El valor de services.

Se aplica a