ServiceCollectionExtensions extension
Methods
-
addAlias<TService extends Object, TImplementation extends TService>([bool isGenerated = false])
→ void
-
Registers a transient service of the specified
TService
type
implemented as an alias for the specified TImplementation
type.
TImplementation
must implement TService
.
-
addFactory<TService extends Object>(ServiceLifetime lifetime, ServiceFactory<TService> factory, [bool isGenerated = false])
→ void
-
Registers a service with specified
lifetime
of the specified TService
type
implemented by the specified factory
.
-
addInstance<TService extends Object>(TService instance)
→ void
-
Registers a singleton service of the specified
TService
type
using the specified instance
.
-
addScopedFactory<TService extends Object>(ServiceFactory<TService> factory)
→ void
-
Registers a scoped service of the specified
TService
type
implemented by the specified factory
.
-
addSingletonFactory<TService extends Object>(ServiceFactory<TService> factory)
→ void
-
Registers a singleton service of the specified
TService
type
implemented by the specified factory
.
-
addTransientFactory<TService extends Object>(ServiceFactory<TService> factory)
→ void
-
Registers a transient service of the specified
TService
type
implemented by the specified factory
.
-
buildRootScope()
→ ServiceScope
-
Builds a root ServiceScope.
-
containsService<TService extends Object>()
→ bool
-