Provide different kind of service implement if some condition is met or not
See original GitHub issueHello,
I’ve searched through you’re documentation but it seems not be possible at the moment to provide specific implementation of a service whenever we reach a certain condition with a value coming from a property file.
What I am intending to do with that is something like:
Hey, is there a properties in your
.ini
file set to this value ? Okay, then service implementation is A, otherwise it should be B
Here’s what I am trying to do: https://gist.github.com/MadJlzz/22f977a6fd91e48d3c120dd9de9510f9
I know it is not working but I guess you will understand what I’ve tried to do. I’ve also understand that providers.Configuration
is to load properties from a file and inject those inside one of the dependencies we are wishing to create. (so bad use in my example)
If not possible at the moment, it could be a nice feature, no?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
No problems, you’re welcome.
Most of the examples and providers take their origin from the issues like that. Thanks for raising that one. That’s not a bad idea to have an example with
Selector
provider better promoted.Feel free to open another one if you see something not working, or not clear, or you just need an advice.
Okay, I guess I really need to clean my glasses before creating an issue. Thanks a lot for the support!