【发布时间】:2016-04-08 01:49:37
【问题描述】:
假设我有一个控制器:
public BController : Controller
{
public ActionResult Foo(FooViewModel vm)
{
...
}
}
同时我正在另一个控制器 AController 中实现一个动作,我想在其中呈现 BController.Foo 传递特定模型对象的结果。所以:
public AController : Controller
{
public ActionResult Bar(BarViewModel vm)
{
FooViewModel fooVm = MakeFooVM(vm);
return ... ; // pass fooVm to BController
}
}
有没有办法在 MVC 中实现这一点?
【问题讨论】: