AutoActivationExtensions.TryAddActivatedSingleton Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Överlagringar
| Name | Description |
|---|---|
| TryAddActivatedSingleton(IServiceCollection, Type) |
Försöker lägga till en automatiskt aktiverad singleton-tjänst. |
| TryAddActivatedSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>) |
Försöker lägga till en automatiskt aktiverad singleton-tjänst. |
| TryAddActivatedSingleton(IServiceCollection, Type, Type) |
Försöker lägga till en automatiskt aktiverad singleton-tjänst. |
| TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection) |
Försöker lägga till en automatiskt aktiverad singleton-tjänst. |
| TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>) |
Försöker lägga till en automatiskt aktiverad singleton-tjänst. |
| TryAddActivatedSingleton<TService>(IServiceCollection) |
Försöker lägga till en automatiskt aktiverad singleton-tjänst. |
TryAddActivatedSingleton(IServiceCollection, Type)
Försöker lägga till en automatiskt aktiverad singleton-tjänst.
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)
Parametrar
- services
- IServiceCollection
Tjänstsamlingen som tjänsten ska läggas till i.
- serviceType
- Type
Vilken typ av tjänst som ska registreras.
Gäller för
TryAddActivatedSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)
Försöker lägga till en automatiskt aktiverad singleton-tjänst.
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))
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.
Gäller för
TryAddActivatedSingleton(IServiceCollection, Type, Type)
Försöker lägga till en automatiskt aktiverad singleton-tjänst.
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)
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.
Gäller för
TryAddActivatedSingleton<TService,TImplementation>(IServiceCollection)
Försöker lägga 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 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)
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.
Gäller för
TryAddActivatedSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)
Försöker lägga till en automatiskt aktiverad singleton-tjänst.
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))
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.
Gäller för
TryAddActivatedSingleton<TService>(IServiceCollection)
Försöker lägga till en automatiskt aktiverad singleton-tjänst.
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)
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.