Bagikan melalui


ServiceDescriptor.Singleton Metode

Definisi

Overload

Singleton(Type, Func<IServiceProvider,Object>)

Membuat instans ServiceDescriptor dengan , , implementationFactorydan Singleton masa pakai yang ditentukanserviceType.

Singleton(Type, Object)

Membuat instans ServiceDescriptor dengan , , implementationInstancedan Scoped masa pakai yang ditentukanserviceType.

Singleton(Type, Type)

Membuat instans ServiceDescriptor dengan yang ditentukan service dan implementationType dan masa pakainya Singleton .

Singleton<TService,TImplementation>()

Membuat instans ServiceDescriptor dengan , , TImplementationdan Singleton masa pakai yang ditentukanTService.

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

Membuat instans ServiceDescriptor dengan , , TImplementation, implementationFactorydan Singleton masa pakai yang ditentukanTService.

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

Membuat instans ServiceDescriptor dengan , , implementationFactorydan Singleton masa pakai yang ditentukanTService.

Singleton<TService>(TService)

Membuat instans ServiceDescriptor dengan , , implementationInstancedan Scoped masa pakai yang ditentukanTService.

Singleton(Type, Func<IServiceProvider,Object>)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , implementationFactorydan Singleton masa pakai yang ditentukanserviceType.

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

Parameter

serviceType
Type

Jenis layanan.

implementationFactory
Func<IServiceProvider,Object>

Pabrik untuk membuat instans baru implementasi layanan.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

Singleton(Type, Object)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , implementationInstancedan Scoped masa pakai yang ditentukanserviceType.

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

Parameter

serviceType
Type

Jenis layanan.

implementationInstance
Object

Instans implementasi.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

Singleton(Type, Type)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan yang ditentukan service dan implementationType dan masa pakainya 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

Parameter

service
Type

Jenis layanan.

implementationType
Type

Jenis implementasinya.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

Singleton<TService,TImplementation>()

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , TImplementationdan Singleton masa pakai yang ditentukanTService.

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

Jenis parameter

TService

Jenis layanan.

TImplementation

Jenis implementasinya.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

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

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , TImplementation, implementationFactorydan Singleton masa pakai yang ditentukanTService.

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

Jenis parameter

TService

Jenis layanan.

TImplementation

Jenis implementasinya.

Parameter

implementationFactory
Func<IServiceProvider,TImplementation>

Pabrik untuk membuat instans baru implementasi layanan.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

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

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , implementationFactorydan Singleton masa pakai yang ditentukanTService.

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

Jenis parameter

TService

Jenis layanan.

Parameter

implementationFactory
Func<IServiceProvider,TService>

Pabrik untuk membuat instans baru implementasi layanan.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk

Singleton<TService>(TService)

Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs
Sumber:
ServiceDescriptor.cs

Membuat instans ServiceDescriptor dengan , , implementationInstancedan Scoped masa pakai yang ditentukanTService.

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

Jenis parameter

TService

Jenis layanan.

Parameter

implementationInstance
TService

Instans implementasi.

Mengembalikan

Instans baru .ServiceDescriptor

Berlaku untuk