ServiceDescriptor.Singleton Metoda

Definice

Přetížení

Singleton(Type, Func<IServiceProvider,Object>)

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

Singleton(Type, Object)

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

Singleton(Type, Type)

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

Singleton<TService,TImplementation>()

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

Singleton<TService,TImplementation>(Func<IServiceProvider,TImplementation>)

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

Singleton<TService>(Func<IServiceProvider,TService>)

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

Singleton<TService>(TService)

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

Singleton(Type, Func<IServiceProvider,Object>)

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

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

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

Parametry

serviceType
Type

Typ služby.

implementationFactory
Func<IServiceProvider,Object>

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

Návraty

Nová instance objektu ServiceDescriptor.

Platí pro

Singleton(Type, Object)

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

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

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

Parametry

serviceType
Type

Typ služby.

implementationInstance
Object

Instance implementace.

Návraty

Nová instance objektu ServiceDescriptor.

Platí pro

Singleton(Type, Type)

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

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

public:
 static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Singleton(Type ^ service, Type ^ implementationType);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Singleton (Type service, Type implementationType);
static member Singleton : Type * Type -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function Singleton (service As Type, implementationType As Type) As ServiceDescriptor

Parametry

service
Type

Typ služby.

implementationType
Type

Typ implementace.

Návraty

Nová instance objektu ServiceDescriptor.

Platí pro

Singleton<TService,TImplementation>()

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

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

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Singleton();
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Singleton<TService,TImplementation> () where TService : class where TImplementation : class, TService;
static member Singleton : unit -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function Singleton(Of TService As Class, TImplementation As Class) () As ServiceDescriptor

Parametry typu

TService

Typ služby.

TImplementation

Typ implementace.

Návraty

Nová instance objektu ServiceDescriptor.

Platí pro

Singleton<TService,TImplementation>(Func<IServiceProvider,TImplementation>)

Zdroj:
ServiceDescriptor.cs
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 ^ Singleton(Func<IServiceProvider ^, TImplementation> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Singleton<TService,TImplementation> (Func<IServiceProvider,TImplementation> implementationFactory) where TService : class where TImplementation : class, TService;
static member Singleton : Func<IServiceProvider, #'Service> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function Singleton(Of TService As Class, TImplementation As Class) (implementationFactory As Func(Of IServiceProvider, TImplementation)) As ServiceDescriptor

Parametry typu

TService

Typ služby.

TImplementation

Typ implementace.

Parametry

implementationFactory
Func<IServiceProvider,TImplementation>

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

Návraty

Nová instance objektu ServiceDescriptor.

Platí pro

Singleton<TService>(Func<IServiceProvider,TService>)

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

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

public:
generic <typename TService>
 where TService : class static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Singleton(Func<IServiceProvider ^, TService> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Singleton<TService> (Func<IServiceProvider,TService> implementationFactory) where TService : class;
static member Singleton : Func<IServiceProvider, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function Singleton(Of TService As Class) (implementationFactory As Func(Of IServiceProvider, TService)) As ServiceDescriptor

Parametry typu

TService

Typ služby.

Parametry

implementationFactory
Func<IServiceProvider,TService>

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

Návraty

Nová instance objektu ServiceDescriptor.

Platí pro

Singleton<TService>(TService)

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

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

public:
generic <typename TService>
 where TService : class static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Singleton(TService implementationInstance);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Singleton<TService> (TService implementationInstance) where TService : class;
static member Singleton : 'Service -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function Singleton(Of TService As Class) (implementationInstance As TService) As ServiceDescriptor

Parametry typu

TService

Typ služby.

Parametry

implementationInstance
TService

Instance implementace.

Návraty

Nová instance objektu ServiceDescriptor.

Platí pro