Bewerken

Delen via


KeyedServiceCollection<TKey,TService>.GetService Method

Definition

Gets the service with the specified key.

public TService GetService (IServiceProvider services, TKey key);
abstract member GetService : IServiceProvider * 'Key -> 'Service
override this.GetService : IServiceProvider * 'Key -> 'Service
Public Function GetService (services As IServiceProvider, key As TKey) As TService

Parameters

services
IServiceProvider

The service provider.

key
TKey

The key.

Returns

TService

The service with the specified key.

Implements

Applies to