3 ms·
Or just create two versions of the constructor - one that takes the arg, and one that doesn't. The one that doesn't does whatever magic you were planning for t
by ars 4y ago
Or just create two versions of the constructor - one that takes the arg, and one that doesn't.
The one that doesn't does whatever magic you were planning for the DI, does that, then calls the constructor with the arg.
- 9dev 4y agoPlanning magic isn't necessary! What if your class requires a new dependency?