İngilizce dilinde oku

Aracılığıyla paylaş


ServiceProviderKeyedServiceExtensions Class

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Extension methods for getting services from an IServiceProvider.

C#
public static class ServiceProviderKeyedServiceExtensions
Inheritance
ServiceProviderKeyedServiceExtensions

Methods

GetKeyedService(IServiceProvider, Type, Object)

Get service of type serviceType from the IServiceProvider.

GetKeyedService<T>(IServiceProvider, Object)

Get service of type T from the IServiceProvider.

GetKeyedServices(IServiceProvider, Type, Object)

Get an enumeration of services of type serviceType from the IServiceProvider.

GetKeyedServices<T>(IServiceProvider, Object)

Get an enumeration of services of type T from the IServiceProvider.

GetRequiredKeyedService(IServiceProvider, Type, Object)

Get service of type serviceType from the IServiceProvider.

GetRequiredKeyedService<T>(IServiceProvider, Object)

Get service of type T from the IServiceProvider.

Applies to

Ürün Sürümler
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)