我有 2 个控制器CustomerController
和PrivatemessageController
客户有一个不作为的方法
private readonly ICustomerService _customerService;
public Customer(....) << autofac Ioc
{
}
[NonAction]
protected CustomerNavigationModel GetCustomerNavigationModel(Customer customer)
{
var model = new CustomerNavigationModel();
.... _customerSerice...
return model;
}
我想从中获得GetCustomerNavigationModel
价值,CustomerController
因为我不想为 重新创建相同的方法PrivateMessageController
,这在 ASP.NET MVC 3.0 中是否可行?