Condividi tramite


IKeyedServiceCollection<TKey,TService>.GetService Metodo

Definizione

Overload

GetService(TKey)
GetService(IServiceProvider, TKey)

Ottiene il servizio con la chiave specificata.

GetService(TKey)

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

Parametri

key
TKey

Restituisce

TService

Si applica a

GetService(IServiceProvider, TKey)

Origine:
IKeyedServiceCollection.cs

Ottiene il servizio con la chiave specificata.

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

Parametri

services
IServiceProvider

Provider del servizio.

key
TKey

Chiave.

Restituisce

TService

Servizio con la chiave specificata.

Si applica a