addFactory<TService extends Object> method

void addFactory<TService extends Object>(
  1. ServiceLifetime lifetime,
  2. ServiceFactory<TService> factory, [
  3. bool isGenerated = false
])

Registers a service with specified lifetime of the specified TService type implemented by the specified factory.

Implementation

void addFactory<TService extends Object>(
  ServiceLifetime lifetime,
  ServiceFactory<TService> factory, [
  bool isGenerated = false,
]) {
  add(ServiceDescriptor.factory<TService>(lifetime, factory, isGenerated));
}