Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required Properties Injection #397

Open
TonyValenti opened this issue Apr 1, 2023 · 1 comment
Open

Required Properties Injection #397

TonyValenti opened this issue Apr 1, 2023 · 1 comment

Comments

@TonyValenti
Copy link

Hi Ninject Team,
AutoFac recently added required property injection and it is awesome.
https://autofac.readthedocs.io/en/latest/register/prop-method-injection.html#required-properties

It removes a ton of boilerplate RE constructors, especially when inheritance is involved.

It would be great if Ninject did the same.

@scott-xu
Copy link
Member

scott-xu commented Apr 7, 2023

You can set NinjectSetting.InjectAttribute to typeof(RequiredMemberAttribute) if you just want to simpliy inject required properties. However, it does not cover cases where constructor has SetsRequiredMembersAttribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants