AutoActivationExtensions.AddActivatedSingleton Metod

Definition

Överlagringar

Name Description
AddActivatedSingleton(IServiceCollection, Type)

Lägger till en automatiskt aktiverad singleton-tjänst av den typ som anges i serviceType till den angivna IServiceCollection.

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

Lägger till en automatiskt aktiverad singleton-tjänst.

AddActivatedSingleton(IServiceCollection, Type, Type)

Lägger till en automatiskt aktiverad singleton-tjänst.

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

Lägger till en automatiskt aktiverad singleton-tjänst.

AddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Lägger till en automatiskt aktiverad singleton-tjänst.

AddActivatedSingleton<TService>(IServiceCollection)

Lägger till en automatiskt aktiverad singleton-tjänst.

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

Lägger till en automatiskt aktiverad singleton-tjänst.

AddActivatedSingleton(IServiceCollection, Type)

Källa:
AutoActivationExtensions.cs
Källa:
AutoActivationExtensions.cs

Lägger till en automatiskt aktiverad singleton-tjänst av den typ som anges i serviceType till den angivna 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

Parametrar

services
IServiceCollection

Tjänstsamlingen som tjänsten ska läggas till i.

serviceType
Type

Vilken typ av tjänst som ska registreras och vilken implementering som ska användas.

Returer

Värdet för services.

Gäller för

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

Källa:
AutoActivationExtensions.cs
Källa:
AutoActivationExtensions.cs

Lägger till en automatiskt aktiverad singleton-tjänst.

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

Parametrar

services
IServiceCollection

Tjänstsamlingen som tjänsten ska läggas till i.

serviceType
Type

Vilken typ av tjänst som ska registreras.

implementationFactory
Func<IServiceProvider,Object>

Fabriken som skapar tjänsten.

Returer

Värdet för services.

Gäller för

AddActivatedSingleton(IServiceCollection, Type, Type)

Källa:
AutoActivationExtensions.cs
Källa:
AutoActivationExtensions.cs

Lägger till en automatiskt aktiverad singleton-tjänst.

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

Parametrar

services
IServiceCollection

Tjänstsamlingen som tjänsten ska läggas till i.

serviceType
Type

Vilken typ av tjänst som ska registreras.

implementationType
Type

Implementeringstypen för tjänsten.

Returer

Värdet för services.

Gäller för

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

Källa:
AutoActivationExtensions.cs
Källa:
AutoActivationExtensions.cs

Lägger till en automatiskt aktiverad singleton-tjänst.

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

Typparametrar

TService

Vilken typ av tjänst som ska läggas till.

TImplementation

Vilken typ av implementering som ska användas.

Parametrar

services
IServiceCollection

Tjänstsamlingen som tjänsten ska läggas till i.

implementationFactory
Func<IServiceProvider,TImplementation>

Fabriken som skapar tjänsten.

Returer

Värdet för services.

Gäller för

AddActivatedSingleton<TService,TImplementation>(IServiceCollection)

Källa:
AutoActivationExtensions.cs
Källa:
AutoActivationExtensions.cs

Lägger till en automatiskt aktiverad singleton-tjänst.

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

Typparametrar

TService

Vilken typ av tjänst som ska läggas till.

TImplementation

Vilken typ av implementering som ska användas.

Parametrar

services
IServiceCollection

Tjänstsamlingen som tjänsten ska läggas till i.

Returer

Värdet för services.

Gäller för

AddActivatedSingleton<TService>(IServiceCollection)

Källa:
AutoActivationExtensions.cs
Källa:
AutoActivationExtensions.cs

Lägger till en automatiskt aktiverad singleton-tjänst.

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

Typparametrar

TService

Vilken typ av tjänst som ska läggas till.

Parametrar

services
IServiceCollection

Tjänstsamlingen som tjänsten ska läggas till i.

Returer

Värdet för services.

Gäller för

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

Källa:
AutoActivationExtensions.cs
Källa:
AutoActivationExtensions.cs

Lägger till en automatiskt aktiverad singleton-tjänst.

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

Typparametrar

TService

Vilken typ av tjänst som ska läggas till.

Parametrar

services
IServiceCollection

Tjänstsamlingen som tjänsten ska läggas till i.

implementationFactory
Func<IServiceProvider,TService>

Fabriken som skapar tjänsten.

Returer

Värdet för services.

Gäller för