Update src/roadmaps/aspnet-core/content/105-dependency-injection/102-life-cycles/index.md

pull/3294/head
Kamran Ahmed 2 years ago committed by GitHub
parent 001f0d31a3
commit 6ce6ce36d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/roadmaps/aspnet-core/content/105-dependency-injection/102-life-cycles/index.md

@ -1,6 +1,12 @@
# Life Cycles
In ASP.NET, dependency injection (DI) lifecycles determine the lifetime of objects that are resolved through the DI container. There are several predefined lifecycle options in the `Microsoft.Extensions.DependencyInjection` library, including:
- **Transient:** A new instance of the object is created every time it is requested.
- **Scoped:** A new instance of the object is created for each request within the same scope.
- **Singleton:** A single instance of the object is created and shared across the entire application.
Additionally, you can also create a custom lifecycle by implementing the `Microsoft.Extensions.DependencyInjection.IServiceScopeFactory` interface
For more resources, visit the following links:

Loading…
Cancel
Save