Hi,
I've always been told that you don't inject unity into a viewmodel. Just what objects you need in a constructor etc.So lets say im in a private method.
Now I need to new up an object
var someclass = new classWithInterface();
Now my viewmodel is dependent on classWithinterface.
One way to get around this is to pass unity into the constructor and then use unity to resolve my ClassWithinterface object.
Is there any other means to achieve this? Was I wrong in assuming passing unity into the viewmodel is bad practise etc?
Thanks