Compartilhar via


IKeyedServiceCollection<TKey,TService>.GetService Método

Definição

Sobrecargas

GetService(TKey)
GetService(IServiceProvider, TKey)

Obtém o serviço com a chave especificada.

GetService(TKey)

public TService GetService (TKey key);
abstract member GetService : 'Key -> 'Service
Public Function GetService (key As TKey) As TService

Parâmetros

key
TKey

Retornos

TService

Aplica-se a

GetService(IServiceProvider, TKey)

Origem:
IKeyedServiceCollection.cs

Obtém o serviço com a chave especificada.

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

Parâmetros

services
IServiceProvider

O provedor de serviços.

key
TKey

A chave.

Retornos

TService

O serviço com a chave especificada.

Aplica-se a