Dependency Injection Lifetime: Transient, Singleton & Scoped

Understanding the lifetime of the services created using the Dependency injection is very essential, before starting to using them. Creating services without understanding the difference between Transient, Singleton & Scoped lifetime can result in application behaving erratically. When a service requests another service via DI, knowing whether it receives the new instance or an already created instance is very important. Hence correctly specifying the lifetime while registering the service are utmost important.

Dependency Injection Lifetime: Transient, Singleton & Scoped Read More »