I'm trying to get the IoC concept down with a winforms app. Say I have a presenter whose constructor takes its view and a service as constructor arguments. So in the form code I have something that amounts to this:
mnPresenter = new Presenter(this, new AppService());
where, say AppService is an implementation of IAppService. It's registered in my [autofac] IoC container. What's the recommended way of getting the "new" out of this presenter construction? Isn't the whole point of using an IoC framework to lose these "new" calls like I'm making above?
I could do something like
mPresenter = new Presenter(this, MyContainer.Resolve<IAppService>())
but that seems to defeat the purpose of IoC. I'm probably missing something fundamental here.
Apologies in advance if I'm missing something obvious.