0
在棱镜Commanding_Desktop快速启动溶液,在OrderModule,它定义了一个变量为以下:在棱镜中注册哪些类型?
this.container.Resolve<OrdersEditorPresentationModel>()
但其中这个被注册,以便它可以被“解决”从容器中?我在下面看到OrdersRepository正在注册,但我找不到在哪里项目OrdersEditorPresentationModel正在注册。
OrderModule.cs:
public void Initialize()
{
this.container.RegisterType<IOrdersRepository, OrdersRepository>(new ContainerControlledLifetimeManager());
OrdersEditorPresentationModel presentationModel = this.container.Resolve<OrdersEditorPresentationModel>();
...
}
OrdersEditorPresentationModel.cs:
public class OrdersEditorPresentationModel : INotifyPropertyChanged
{
...
public OrdersEditorPresentationModel(OrdersEditorView view, IOrdersRepository ordersRepository, OrdersCommandProxy commandProxy)
{
this.ordersRepository = ordersRepository;
this.commandProxy = commandProxy;
this.Orders = new ObservableCollection<OrderPresentationModel>();
this.PopulateOrders();
this.View = view;
view.Model = this;
}
...
在类型的构造上述被解决具有特定的签名,但其中是这个签名被定义为:
public OrdersEditorPresentationModel(OrdersEditorView view,
IOrdersRepository ordersRepository,
OrdersCommandProxy commandProxy)
我想这可能是一些默认的签名,但棱镜文档中的另一个例子,演示构造有不同的签名:
public EmployeesPresenter(IEmployeesView view,
IEmployeesListPresenter listPresenter,
IEmployeesController employeeController)