Specifies the contract for a collection of service descriptors.
// List of service descriptors describing the services and their lifetimes.
serviceDescriptors: Map<string, IServiceDescriptor>
// Defines a service that will be instantiated new every call
addTransient<T extends object>(key: string, factory: () => T): void
// Defines a service that will be instantiated once per fetch request
addScoped<T extends object>(key: string, factory: () => T): void
// Defines a service that will be instantiated once and used thereafter
addSingleton<T extends object>(key: string, factory: () => T): void
// Defines a configuration object available to middleware.
configure<T extends object>(optionsName: string, options: T): void
IServiceCollection
is available in the configureServices
call of your IStartup
implementation.