webformsmvp

Pass runtime value to constructor using Simple Injector abd WebFormsMVP

删除回忆录丶 提交于 2019-12-17 20:13:18
问题 I'm trying to combine SimpleInjector with WebFormsMvp . To facilitate DI WebFormsMvp provides the IPresenterFactory interface. It contains the Create method which provides the presenter type to resolve and the view instance . I need to inject the view instance into the constructor of the presenter . The presenter also has other dependencies that need creating by the container . This is what I got so far, but it is not ideal. What's the correct solution for the problem? Presenter constructor:

Pass runtime value to constructor using Simple Injector abd WebFormsMVP

偶尔善良 提交于 2019-11-28 12:23:46
I'm trying to combine SimpleInjector with WebFormsMvp . To facilitate DI WebFormsMvp provides the IPresenterFactory interface. It contains the Create method which provides the presenter type to resolve and the view instance . I need to inject the view instance into the constructor of the presenter . The presenter also has other dependencies that need creating by the container . This is what I got so far, but it is not ideal. What's the correct solution for the problem? Presenter constructor: public FooPresenter(IFooView view, IClientFactory clientFactory) : base(view) Factory: public class