keyedSingletonInstance<TService> static method

ServiceDescriptor keyedSingletonInstance<TService>(
  1. Object? serviceKey,
  2. Object implementationInstance
)

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

Implementation

static ServiceDescriptor keyedSingletonInstance<TService>(
  Object? serviceKey,
  Object implementationInstance,
) =>
    ServiceDescriptor._instance(
      serviceType: TService,
      serviceKey: serviceKey,
      instance: implementationInstance,
    );