/// <summary> /// Executes the specified action against the current context. /// </summary> /// <typeparam name="TController">The type of the controller.</typeparam> /// <param name="action">The expression containing the action and its parameters.</param> public void Component <TController>(Expression <Action <TController> > action) where TController : Controller { ComponentController component = new ComponentController(); component.RenderAction <TController>(Context, action); }
/// <summary> /// Executes the specified action against the current context. /// </summary> /// <param name="controller">The name of the controller.</param> /// <param name="action">The name of the action.</param> /// <param name="arguments">The arguments of the action.</param> public void Component(string controller, string action, ValueDictionary arguments) { Precondition.Defined(controller, () => Error.ArgumentNull("controller")); Precondition.Defined(action, () => Error.ArgumentNull("action")); if (arguments == null) { arguments = new ValueDictionary(); } ComponentController component = new ComponentController(); component.RenderAction(Context, controller, action, arguments); }