Share via


ServiceDescriptor.KeyedSingleton Metoda

Definice

Přetížení

KeyedSingleton(Type, Object, Func<IServiceProvider,Object,Object>)

Vytvoří instanci se ServiceDescriptor zadanými serviceType, implementationFactorya životností Singleton .

KeyedSingleton(Type, Object, Object)

Vytvoří instanci se ServiceDescriptor zadanými serviceType, implementationInstancea životností Singleton .

KeyedSingleton(Type, Object, Type)

Vytvoří instanci se ServiceDescriptor zadanými service a implementationType a Singleton životností.

KeyedSingleton<TService,TImplementation>(Object, Func<IServiceProvider,Object,TImplementation>)

Vytvoří instanci se ServiceDescriptor zadanými TService, TImplementation, implementationFactorya životností Singleton .

KeyedSingleton<TService,TImplementation>(Object)

Vytvoří instanci se ServiceDescriptor zadanými TService, TImplementationa životností Singleton .

KeyedSingleton<TService>(Object, Func<IServiceProvider,Object,TService>)

Vytvoří instanci se ServiceDescriptor zadanými TService, implementationFactorya životností Singleton .

KeyedSingleton<TService>(Object, TService)

Vytvoří instanci se ServiceDescriptor zadanými TService, implementationInstancea životností Singleton .

KeyedSingleton(Type, Object, Func<IServiceProvider,Object,Object>)

Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs

Vytvoří instanci se ServiceDescriptor zadanými serviceType, implementationFactorya životností Singleton .

public:
 static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(Type ^ serviceType, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, System::Object ^> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton (Type serviceType, object? serviceKey, Func<IServiceProvider,object?,object> implementationFactory);
static member KeyedSingleton : Type * obj * Func<IServiceProvider, obj, obj> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function KeyedSingleton (serviceType As Type, serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, Object)) As ServiceDescriptor

Parametry

serviceType
Type

Typ služby.

serviceKey
Object

Služby ServiceKey .

implementationFactory
Func<IServiceProvider,Object,Object>

Objekt pro vytváření nových instancí implementace služby.

Návraty

Nová instance .ServiceDescriptor

Platí pro

KeyedSingleton(Type, Object, Object)

Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs

Vytvoří instanci se ServiceDescriptor zadanými serviceType, implementationInstancea životností Singleton .

public:
 static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(Type ^ serviceType, System::Object ^ serviceKey, System::Object ^ implementationInstance);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton (Type serviceType, object? serviceKey, object implementationInstance);
static member KeyedSingleton : Type * obj * obj -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function KeyedSingleton (serviceType As Type, serviceKey As Object, implementationInstance As Object) As ServiceDescriptor

Parametry

serviceType
Type

Typ služby.

serviceKey
Object

Služby ServiceKey .

implementationInstance
Object

Instance implementace.

Návraty

Nová instance .ServiceDescriptor

Platí pro

KeyedSingleton(Type, Object, Type)

Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs

Vytvoří instanci se ServiceDescriptor zadanými service a implementationType a Singleton životností.

public:
 static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(Type ^ service, System::Object ^ serviceKey, Type ^ implementationType);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton (Type service, object? serviceKey, Type implementationType);
static member KeyedSingleton : Type * obj * Type -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function KeyedSingleton (service As Type, serviceKey As Object, implementationType As Type) As ServiceDescriptor

Parametry

service
Type

Typ služby.

serviceKey
Object

Služby ServiceKey .

implementationType
Type

Typ implementace.

Návraty

Nová instance .ServiceDescriptor

Platí pro

KeyedSingleton<TService,TImplementation>(Object, Func<IServiceProvider,Object,TImplementation>)

Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs

Vytvoří instanci se ServiceDescriptor zadanými TService, TImplementation, implementationFactorya životností Singleton .

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, TImplementation> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService,TImplementation> (object? serviceKey, Func<IServiceProvider,object?,TImplementation> implementationFactory) where TService : class where TImplementation : class, TService;
static member KeyedSingleton : obj * Func<IServiceProvider, obj, #'Service> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function KeyedSingleton(Of TService As Class, TImplementation As Class) (serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, TImplementation)) As ServiceDescriptor

Parametry typu

TService

Typ služby.

TImplementation

Typ implementace.

Parametry

serviceKey
Object

Služby ServiceKey .

implementationFactory
Func<IServiceProvider,Object,TImplementation>

Objekt pro vytváření nových instancí implementace služby.

Návraty

Nová instance .ServiceDescriptor

Platí pro

KeyedSingleton<TService,TImplementation>(Object)

Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs

Vytvoří instanci se ServiceDescriptor zadanými TService, TImplementationa životností Singleton .

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(System::Object ^ serviceKey);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService,TImplementation> (object? serviceKey) where TService : class where TImplementation : class, TService;
static member KeyedSingleton : obj -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function KeyedSingleton(Of TService As Class, TImplementation As Class) (serviceKey As Object) As ServiceDescriptor

Parametry typu

TService

Typ služby.

TImplementation

Typ implementace.

Parametry

serviceKey
Object

Služby ServiceKey .

Návraty

Nová instance .ServiceDescriptor

Platí pro

KeyedSingleton<TService>(Object, Func<IServiceProvider,Object,TService>)

Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs

Vytvoří instanci se ServiceDescriptor zadanými TService, implementationFactorya životností Singleton .

public:
generic <typename TService>
 where TService : class static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, TService> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService> (object? serviceKey, Func<IServiceProvider,object?,TService> implementationFactory) where TService : class;
static member KeyedSingleton : obj * Func<IServiceProvider, obj, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function KeyedSingleton(Of TService As Class) (serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, TService)) As ServiceDescriptor

Parametry typu

TService

Typ služby.

Parametry

serviceKey
Object

Služby ServiceKey .

implementationFactory
Func<IServiceProvider,Object,TService>

Objekt pro vytváření nových instancí implementace služby.

Návraty

Nová instance .ServiceDescriptor

Platí pro

KeyedSingleton<TService>(Object, TService)

Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs
Zdroj:
ServiceDescriptor.cs

Vytvoří instanci se ServiceDescriptor zadanými TService, implementationInstancea životností Singleton .

public:
generic <typename TService>
 where TService : class static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ KeyedSingleton(System::Object ^ serviceKey, TService implementationInstance);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor KeyedSingleton<TService> (object? serviceKey, TService implementationInstance) where TService : class;
static member KeyedSingleton : obj * 'Service -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function KeyedSingleton(Of TService As Class) (serviceKey As Object, implementationInstance As TService) As ServiceDescriptor

Parametry typu

TService

Typ služby.

Parametry

serviceKey
Object

Služby ServiceKey .

implementationInstance
TService

Instance implementace.

Návraty

Nová instance .ServiceDescriptor

Platí pro