Scrutor
Scrutor copied to clipboard
Support for IOptions<T> ?
Hello,
I have a folder containing all my classes used to use dependency injection with IOptions<T> Microsoft doc
I would like it to be registered automatically as for my repositories is possible with your version currently? or does it require a feature?
Best regards
Just to chime in, I am in the same situation of looking at pre-existing DI scanning/discovery where the previous author implemented their own settings related approaches but I'm aiming to replace that with proper Options<T> support.
With Scrutor, I'm now unable to scan & register using the services.AddOptions<T> approach (or equivalents that work with a Type) so I'm finding that I'll have to move away from Scrutor for these needs.
So +1 for this support as a feature request for the future.
Also, I'm looking for ways to call AddOptions (or Configure) that accept a Type but yet let me work against the OptionsBuilder so that I can easily add the ValidateDataAnnotations and ValidateOnStart to the registered types.
Same situation. Would be great to add AddOptions support.
I managed to add this very basic support for IOptions<T> in my own Autowiring library here. I'm sure it's possible to add support for this in Scrutor.