Your solution is exactly how this problem should be solved. Yes, things get somehow messy when lots of dependencies are involved.
Some more advanced IoC containers, like Unity, can create these kind of factories automagically.
Your solution is exactly how this problem should be solved. Yes, things get somehow messy when lots of dependencies are involved.
Some more advanced IoC containers, like Unity, can create these kind of factories automagically.