src/Zop/Extensions/DependencyInjection/KeyedServiceProviderExtensions.cs
/// <summary>
/// Acquire a service by name.  Throws KeyNotFound exception if name is not found.
/// </summary>
Acquire a service by name.  Throws KeyNotFound exception if name is not found.
Acquire a service by name . Throws KeyNotFound exception if name is not found .
public static TService GetRequiredServiceByName<TService>(this IServiceProvider services, string name)
            where TService : class
        {
            return services.GetRequiredServiceByKey<string, TService>(name);
        }
public static TService GetRequiredServiceByName < TService > ( this IServiceProvider services , string name ) where TService : class { return services . GetRequiredServiceByKey < string , TService > ( name ) ; }
Acquire a service by name.
Acquire a service by name .
IServiceProvider
this
name
string