ServiceDescriptor.Scoped 方法

定義

多載

Scoped(Type, Func<IServiceProvider,Object>)

使用指定的 serviceimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。

Scoped(Type, Type)

使用指定的 serviceimplementationTypeScoped 存留期來建立 ServiceDescriptor 的執行個體。

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

使用指定的 TServiceTImplementationimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。

Scoped<TService,TImplementation>()

使用指定的 TServiceTImplementationScoped 存留期來建立 ServiceDescriptor 的執行個體。

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

使用指定的 TServiceimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。

Scoped(Type, Func<IServiceProvider,Object>)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 serviceimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。

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

參數

service
Type

服務的類型。

implementationFactory
Func<IServiceProvider,Object>

建立服務實作之新執行個體的 Factory。

傳回

ServiceDescriptor 的新執行個體。

適用於

Scoped(Type, Type)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 serviceimplementationTypeScoped 存留期來建立 ServiceDescriptor 的執行個體。

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

參數

service
Type

服務的類型。

implementationType
Type

實作的類型。

傳回

ServiceDescriptor 的新執行個體。

適用於

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

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 TServiceTImplementationimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。

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

類型參數

TService

服務的類型。

TImplementation

實作的類型。

參數

implementationFactory
Func<IServiceProvider,TImplementation>

建立服務實作之新執行個體的 Factory。

傳回

ServiceDescriptor 的新執行個體。

適用於

Scoped<TService,TImplementation>()

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 TServiceTImplementationScoped 存留期來建立 ServiceDescriptor 的執行個體。

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

類型參數

TService

服務的類型。

TImplementation

實作的類型。

傳回

ServiceDescriptor 的新執行個體。

適用於

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

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 TServiceimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。

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

類型參數

TService

服務的類型。

參數

implementationFactory
Func<IServiceProvider,TService>

建立服務實作之新執行個體的 Factory。

傳回

ServiceDescriptor 的新執行個體。

適用於