EmptyServiceProvider.IKeyedServiceProvider.GetRequiredKeyedService Method

Definition

Gets service of type serviceType from the IServiceProvider implementing this interface.

 virtual System::Object ^ Microsoft.Extensions.DependencyInjection.IKeyedServiceProvider.GetRequiredKeyedService(Type ^ serviceType, System::Object ^ serviceKey) = Microsoft::Extensions::DependencyInjection::IKeyedServiceProvider::GetRequiredKeyedService;
object IKeyedServiceProvider.GetRequiredKeyedService(Type serviceType, object serviceKey);
abstract member Microsoft.Extensions.DependencyInjection.IKeyedServiceProvider.GetRequiredKeyedService : Type * obj -> obj
override this.Microsoft.Extensions.DependencyInjection.IKeyedServiceProvider.GetRequiredKeyedService : Type * obj -> obj
Function GetRequiredKeyedService (serviceType As Type, serviceKey As Object) As Object Implements IKeyedServiceProvider.GetRequiredKeyedService

Parameters

serviceType
Type

An object that specifies the type of service object to get.

serviceKey
Object

The ServiceKey of the service.

Returns

A service object of type serviceType. Throws an exception if the IServiceProvider cannot create the object.

Implements

Applies to