ServiceDescriptor.DescribeKeyed Method

Definition

Overloads

DescribeKeyed(Type, Object, Func<IServiceProvider,Object,Object>, ServiceLifetime)

Creates an instance of ServiceDescriptor with the specified serviceType, implementationFactory, and lifetime.

DescribeKeyed(Type, Object, Type, ServiceLifetime)

Creates an instance of ServiceDescriptor with the specified serviceType, implementationType, and lifetime.

DescribeKeyed(Type, Object, Func<IServiceProvider,Object,Object>, ServiceLifetime)

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs

Creates an instance of ServiceDescriptor with the specified serviceType, implementationFactory, and lifetime.

public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor DescribeKeyed (Type serviceType, object? serviceKey, Func<IServiceProvider,object?,object> implementationFactory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);

Parameters

serviceType
Type

The type of the service.

serviceKey
Object

The ServiceKey of the service.

implementationFactory
Func<IServiceProvider,Object,Object>

A factory to create new instances of the service implementation.

lifetime
ServiceLifetime

The lifetime of the service.

Returns

A new instance of ServiceDescriptor.

Applies to

.NET 9 (package-provided) e altre versioni
Prodotto Versioni
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

DescribeKeyed(Type, Object, Type, ServiceLifetime)

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs

Creates an instance of ServiceDescriptor with the specified serviceType, implementationType, and lifetime.

public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor DescribeKeyed (Type serviceType, object? serviceKey, Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);

Parameters

serviceType
Type

The type of the service.

serviceKey
Object

The ServiceKey of the service.

implementationType
Type

The type of the implementation.

lifetime
ServiceLifetime

The lifetime of the service.

Returns

A new instance of ServiceDescriptor.

Applies to

.NET 9 (package-provided) e altre versioni
Prodotto Versioni
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)