ServiceProvider.GetRequiredKeyedService(Type, Object) Metodo

Definizione

Ottiene l'oggetto servizio del tipo specificato.

public:
 virtual System::Object ^ GetRequiredKeyedService(Type ^ serviceType, System::Object ^ serviceKey);
public object GetRequiredKeyedService(Type serviceType, object? serviceKey);
abstract member GetRequiredKeyedService : Type * obj -> obj
override this.GetRequiredKeyedService : Type * obj -> obj
Public Function GetRequiredKeyedService (serviceType As Type, serviceKey As Object) As Object

Parametri

serviceType
Type

Tipo del servizio da ottenere.

serviceKey
Object

Chiave del servizio da ottenere.

Valori restituiti

Servizio con chiave.

Implementazioni

Eccezioni

Il servizio non è stato trovato o il AnyKey valore viene usato per serviceKey quando serviceType non è un enumerabile basato su IEnumerable<T>.

Si applica a