keyedSingleton<TService> static method

ServiceDescriptor keyedSingleton<TService>(
  1. Object? serviceKey,
  2. ImplementationFactory implementationFactory
)

Creates an instance of ServiceDescriptor with the specified TService, serviceKey, implementationFactory and the ServiceLifetime.singleton lifetime.

Implementation

static ServiceDescriptor keyedSingleton<TService>(
  Object? serviceKey,
  ImplementationFactory implementationFactory,
) =>
    ServiceDescriptor._factory(
      serviceType: TService,
      serviceKey: serviceKey,
      factory: implementationFactory,
      lifetime: ServiceLifetime.singleton,
    );