tryAddKeyedScoped<TService> method

void tryAddKeyedScoped<TService>(
  1. Object? serviceKey,
  2. KeyedImplementationFactory implementationFactory
)

Implementation

void tryAddKeyedScoped<TService>(
  Object? serviceKey,
  KeyedImplementationFactory implementationFactory,
) {
  var descriptor = ServiceDescriptor.keyedScoped<TService>(
    serviceKey,
    (services) => implementationFactory,
  );
  tryAdd(descriptor);
}