Back to Developer Roadmap

Transient

src/data/roadmaps/aspnet-core/content/[email protected]

4.0956 B
Original Source

Transient

Transient lifetime is a type of dependency injection that creates a new instance of an object each time it is requested. This means that if multiple components within the same request or across different requests depend on the same service, they will each receive a new instance of the service.

Transient lifetime is useful when you have services that are stateless and do not need to maintain any data between requests, such as a service that performs a simple calculation or returns data from a database.

Visit the following resources to learn more: