-
Notifications
You must be signed in to change notification settings - Fork 777
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
SimpleContainer not using the default constructor. #372
Comments
Right now It wouldn't be difficult to change this. I'd look at the |
What's the best strategy to implement here?
This is the best selection when we don't know anything about the parameters provided as it promises the largest flexibility to use all arguments. But as far as I understand the SimpleContainer we know all parameters that can be reliably resolved. When selecting the right constructor (SeletEligibleConstructor), I propose to choose the public one with least unregistered parameters (types). This is in fact a breaking change to what happens now, but if this issue should be implemented at all, I don't see how that should be possible without breaking changes. |
I agree with the proposal around which constructor to use, also agree that it's a breaking change so will shift it to |
…Container Before always the constructor with the most arguments was chosen. Now I chose the constructor with the best ratio between arguments that can be resolved and those that can't.
Hi,
SimpleContainer is calling the wrong constructor should call AddinOptionsModel() instead of AddinOptionsModel(string filename). Example of code:
// In Bootstrap Configuration
this._container.Singleton<AddinOptionsModel, AddinOptionsModel>();
// In our code
this.AddinOptionsModel = IoC.Get();
Regards
The text was updated successfully, but these errors were encountered: