abpframework / abpframework/abp

Change AbpLazyServiceProvider DI lifetime to IScopedDependency?

Open
#7,227 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
14.4k
Forks
3.7k
Avg merge
15h 32m
Merged PRs (30d)
106

Description

Abp AbpLazyServiceProvider has a transient dependency, which if I understand correctly means that each service injected in a request gets a new instance? Would it be better to make it scoped so that the CachedServices can be used by all services for each request? Forgive me if I have misunderstood the mechanisms of DI.

https://github.com/abpframework/abp/blob/34d66ee70f6d2bf719c251331bbf1eda086960c3/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/AbpLazyServiceProvider.cs#L7-L8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/AbpLazyServiceProvider.cs around the linked lifetime declarations, then inspect how CachedServices is used and how the dependency-injection scope behaves across services in one request. Confirm the appropriate lifetime with focused coverage; done means the request-scoped caching question has a tested resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.