IoC and messy factory methods
Hi... so I've made a class library that uses IoC - i.e. ServiceCollectionExtensions and registering all the dependencies.
In the library I have SomeClass that has 3 dependencies injected in the constructor. Those dependencies also themselves have dependencies, and so on, such that initializing SomeClass without an IoC container becomes messy... Now I need to consume SomeClass from a project that doesn't use IoC. It would be too much work to be able to use the IoC in my new project. What's the general approach for this type of thing?? How can I support an IoC container but also not have to make horrendous factory methods for classes in my class library so that I can consume them without an IoC container...
In the library I have SomeClass that has 3 dependencies injected in the constructor. Those dependencies also themselves have dependencies, and so on, such that initializing SomeClass without an IoC container becomes messy... Now I need to consume SomeClass from a project that doesn't use IoC. It would be too much work to be able to use the IoC in my new project. What's the general approach for this type of thing?? How can I support an IoC container but also not have to make horrendous factory methods for classes in my class library so that I can consume them without an IoC container...