Partager via


KeyedServiceCollectionExtensions.GetServiceByName<TService> Méthode

Définition

Acquérir un service par son nom.

public static TService GetServiceByName<TService> (this IServiceProvider services, string name) where TService : class;
static member GetServiceByName : IServiceProvider * string -> 'Service (requires 'Service : null)
<Extension()>
Public Function GetServiceByName(Of TService As Class) (services As IServiceProvider, name As String) As TService

Paramètres de type

TService

Type de service.

Paramètres

services
IServiceProvider

Fournisseur de services.

name
String

Nom du service.

Retours

TService

Service.

S’applique à