added ability to resolve with parameters at the same time #417
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to have a little bit more improved resolving process if we want to pass in dependencies from other places of our code via the resolving method of the container.
For example let's say we have this:
now let's say we want to resolve the request class but do NOT want to resolve the other 2 variables. Instead we want to pass them via the resolve method:
Now when resolving it will fetch the test1 and insert it in the first instance of
var1
in the parameter list, then see therequest: Request
and resolve that as normal and then see thevar2
and then injecttest2
into that.It does not need to be in any particular order (although you prob should keep resolving to the back for cleanliness.)
As long as you have the correct amount of dependencies specified via the resolve method and resolving methods then you should be good.
Note this only works when resolving parameters is turned off (which it is by default in 2.1)