How does the 3 life cycles of a dependency injection work such as singleton, transient and scope?
How does the 3 life cycles of a dependency injection work such as singleton, transient and scope?
Singleton: A service object is created and provided for all requests. Thus, all requests get the same object;
Transient: will always generate a new instance for each item found that has such a dependency, ie if there are 5 dependencies, 5 different instances will be
scoped: this is different from Transient, which guarantees that in a request an instance of a class is created where there are other dependencies, this single instance is used for all, renewing only on subsequent requests, but maintaining this requirement. p>