abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.94k stars 3.44k forks source link

Change AbpLazyServiceProvider DI lifetime to IScopedDependency? #7227

Open olicooper opened 3 years ago

olicooper commented 3 years ago

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

maliming commented 3 years ago

hi @olicooper

Thanks, I will think about it.