如果我有這樣的主持人 -註冊一個演示了查看
public class LandingPresenter : ILandingPresenter
{
private ILandingView _view { get; set; }
private IProductService _productService { get; set; }
public LandingPresenter(ILandingView view, IProductService)
{
....
}
}
如何註冊這個演示與Autofac考慮到依賴視的,不予登記(但IProductService會)
builder.RegisterType<LandingPresenter>().As<ILandingPresenter>(); ????
你是什麼意思的「視圖不會被註冊」?你想明確提供它或..? –
對不起,在視圖中我會像這樣構造Presenter - Presenter = new LandingPresenter(this); (IProductService會使用Autofac工廠注入) – Paul