ServiceProvider Classe
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
IServiceProvider par défaut.
public ref class ServiceProvider sealed : IAsyncDisposable, IDisposable, IServiceProvider, Microsoft::Extensions::DependencyInjection::IKeyedServiceProvider
public sealed class ServiceProvider : IAsyncDisposable, IDisposable, IServiceProvider, Microsoft.Extensions.DependencyInjection.IKeyedServiceProvider
type ServiceProvider = class
interface IServiceProvider
interface IKeyedServiceProvider
interface IDisposable
interface IAsyncDisposable
Public NotInheritable Class ServiceProvider
Implements IAsyncDisposable, IDisposable, IKeyedServiceProvider, IServiceProvider
- Héritage
-
ServiceProvider
- Implémente
Méthodes
| Nom | Description |
|---|---|
| Dispose() |
Supprime le fournisseur de services et tous les services résolus qui implémentent IDisposable. |
| DisposeAsync() |
Supprime de façon asynchrone le fournisseur de services et tous les services résolus qui implémentent IDisposable ou IAsyncDisposable. |
| GetKeyedService(Type, Object) |
Obtient l’objet de service du type spécifié avec la clé spécifiée. |
| GetRequiredKeyedService(Type, Object) |
Obtient l’objet de service du type spécifié. |
| GetService(Type) |
Obtient l’objet de service du type spécifié. |
Méthodes d’extension
| Nom | Description |
|---|---|
| ConfigureAwait(IAsyncDisposable, Boolean) |
Configure la façon dont les attentes sur les tâches retournées à partir d’un jetable asynchrone sont effectuées. |
| CreateAsyncScope(IServiceProvider) |
Crée un nouveau AsyncServiceScope qui peut être utilisé pour résoudre les services délimités. |
| CreateScope(IServiceProvider) |
Crée un nouveau IServiceScope qui peut être utilisé pour résoudre les services délimités. |
| GetFakeLogCollector(IServiceProvider) |
Obtient l’objet qui collecte les enregistrements de journal envoyés au faux enregistreur d’événements. |
| GetFakeRedactionCollector(IServiceProvider) |
Obtient l’instance du collecteur redactoriel factice à partir du conteneur d’injection de dépendances. |
| GetKeyedService(IServiceProvider, Type, Object) |
Obtenir le service de type |
| GetKeyedService<T>(IServiceProvider, Object) |
Obtenir le service de type |
| GetKeyedServices(IServiceProvider, Type, Object) |
Obtenir une énumération des services de type |
| GetKeyedServices<T>(IServiceProvider, Object) |
Obtenir une énumération des services de type |
| GetRequiredKeyedService(IServiceProvider, Type, Object) |
Obtenir le service de type |
| GetRequiredKeyedService<T>(IServiceProvider, Object) |
Obtenir le service de type |
| GetRequiredService(IServiceProvider, Type) |
Obtenir le service de type |
| GetRequiredService<T>(IServiceProvider) |
Obtenir le service de type |
| GetService<T>(IServiceProvider) |
Obtenir le service de type |
| GetServices(IServiceProvider, Type) |
Obtenir une énumération des services de type |
| GetServices<T>(IServiceProvider) |
Obtenir une énumération des services de type |