From 6ce6ce36d73e52431d45df22f828a94c80f1d3d9 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 14 Jan 2023 15:01:47 +0400 Subject: [PATCH] Update src/roadmaps/aspnet-core/content/105-dependency-injection/102-life-cycles/index.md --- .../105-dependency-injection/102-life-cycles/index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/roadmaps/aspnet-core/content/105-dependency-injection/102-life-cycles/index.md b/src/roadmaps/aspnet-core/content/105-dependency-injection/102-life-cycles/index.md index 0395d7f2e..68b7d3c92 100644 --- a/src/roadmaps/aspnet-core/content/105-dependency-injection/102-life-cycles/index.md +++ b/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: