-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed as not planned
Closed as not planned
Copy link
Labels
area-Extensions-DependencyInjectionquestionAnswer questions and provide assistance, not an issue with source code or documentation.Answer questions and provide assistance, not an issue with source code or documentation.
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
Property injection is not supported in the default service container, but now required members are coming with C# 11.
Describe the solution you'd like
Property injection like in legacy ASP.NET via something like an InjectAttribute could be valuable. Maybe required members should even be automatically detected.
Additional context
I was not able to find any reasoning as to why property injection was omitted in ASP.NET Core's default service container, so I don't know if the fact that property injection was considered a design issue since it makes dependencies optional was a factor.
If it was a factor, a lot of ASP.NET Core boilerplate could be massively reduced via property injection the way required members will now reduce constructor boilerplate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-Extensions-DependencyInjectionquestionAnswer questions and provide assistance, not an issue with source code or documentation.Answer questions and provide assistance, not an issue with source code or documentation.