Namespace ToSic.Sys.DI
Classes
- Generator<TService>
Lazy generator to create multiple new services/objects of a specific type.
- Generator<TService, TOptions>
Lazy generator to create multiple new services/objects of a specific type.
- LazyImplementation<TService>
Enables lazy requesting of objects - won't be available until needed. This is a classic plain-vanilla implementation of Lazy for ServiceProviders.
Note that most code in the ToSic Namespace will prefer LazySvc<TService>
- LazySvc<TService>
Helps us create lazy Service objects. It has some special features:
- It will automatically lazy-attach a logger when used correctly
- It can also be configured with a lazy init function to keep code clean.
This reduces the amount of plumbing in many code files.
It will detect if the provided object/service supports these features. So if it's used for anything that doesn't support logging it will just behave like
Lazy
.
- ServiceSwitcherScoped<T>
Same as the ServiceSwitcher<T> but must have another name so we can register it as scoped.
- ServiceSwitcherSingleton<T>
Similar to the ServiceSwitcher<T> but special.
- ServiceSwitcher<T>
Service to pick one of various services which implement ISwitchableService
Interfaces
- ISwitchableService
This describes a service which may have multiple implementations, and will be picked by the ServiceSwitcher<T>