public ActionResult Copy(int ID = 0) { // ... // copy a child instance // ... } }
publicclassParentController {
public ActionResult Copy(int ID = 0) { // ... var childController = DependencyResolver.Current.GetService<ChildController>(); var result = childController.Copy(childID); // ... } }
public ActionResult 动作方法() { var otherController = DependencyResolver.Current.GetService<另一个控制器的类名>(); var result = otherController.另一个动作方法(); return result; }