Class ControllerActionInvoker
Represents a class that is responsible for invoking the action methods of a controller.
public class ControllerActionInvoker : IActionInvoker
- Inheritance
-
ControllerActionInvoker
- Implements
- Derived
- Inherited Members
Constructors
ControllerActionInvoker()
Initializes a new instance of the ControllerActionInvoker class.
public ControllerActionInvoker()
Properties
Binders
Gets or sets the model binders that are associated with the action.
protected ModelBinderDictionary Binders { get; set; }
Property Value
- ModelBinderDictionary
The model binders that are associated with the action.
Methods
CreateActionResult(ControllerContext, ActionDescriptor, object)
Creates the action result.
protected virtual ActionResult CreateActionResult(ControllerContext controllerContext, ActionDescriptor actionDescriptor, object actionReturnValue)
Parameters
controllerContext
ControllerContextThe controller context.
actionDescriptor
ActionDescriptorThe action descriptor.
actionReturnValue
objectThe action return value.
Returns
- ActionResult
The action result object.
FindAction(ControllerContext, ControllerDescriptor, string)
Finds the information about the action method.
protected virtual ActionDescriptor FindAction(ControllerContext controllerContext, ControllerDescriptor controllerDescriptor, string actionName)
Parameters
controllerContext
ControllerContextThe controller context.
controllerDescriptor
ControllerDescriptorThe controller descriptor.
actionName
stringThe name of the action.
Returns
- ActionDescriptor
Information about the action method.
GetControllerDescriptor(ControllerContext)
Retrieves information about the controller by using the specified controller context.
protected virtual ControllerDescriptor GetControllerDescriptor(ControllerContext controllerContext)
Parameters
controllerContext
ControllerContextThe controller context.
Returns
- ControllerDescriptor
Information about the controller.
GetFilters(ControllerContext, ActionDescriptor)
Retrieves information about the action filters.
protected virtual FilterInfo GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
Parameters
controllerContext
ControllerContextThe controller context.
actionDescriptor
ActionDescriptorThe action descriptor.
Returns
- FilterInfo
Information about the action filters.
GetParameterValue(ControllerContext, ParameterDescriptor)
Gets the value of the specified action-method parameter.
protected virtual object GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor)
Parameters
controllerContext
ControllerContextThe controller context.
parameterDescriptor
ParameterDescriptorThe parameter descriptor.
Returns
- object
The value of the action-method parameter.
GetParameterValues(ControllerContext, ActionDescriptor)
Gets the values of the action-method parameters.
protected virtual IDictionary<string, object> GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
Parameters
controllerContext
ControllerContextThe controller context.
actionDescriptor
ActionDescriptorThe action descriptor.
Returns
- IDictionary<string, object>
The values of the action-method parameters.
InvokeAction(ControllerContext, string)
Invokes the specified action by using the specified controller context.
public virtual bool InvokeAction(ControllerContext controllerContext, string actionName)
Parameters
controllerContext
ControllerContextThe controller context.
actionName
stringThe name of the action to invoke.
Returns
- bool
The result of executing the action.
Exceptions
- ArgumentNullException
The
controllerContext
parameter is null.- ArgumentException
The
actionName
parameter is null or empty.- ThreadAbortException
The thread was aborted during invocation of the action.
- Exception
An unspecified error occurred during invocation of the action.
InvokeActionMethod(ControllerContext, ActionDescriptor, IDictionary<string, object>)
Invokes the specified action method by using the specified parameters and the controller context.
protected virtual ActionResult InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary<string, object> parameters)
Parameters
controllerContext
ControllerContextThe controller context.
actionDescriptor
ActionDescriptorThe action descriptor.
parameters
IDictionary<string, object>The parameters.
Returns
- ActionResult
The result of executing the action method.
InvokeActionMethodWithFilters(ControllerContext, IList<IActionFilter>, ActionDescriptor, IDictionary<string, object>)
Invokes the specified action method by using the specified parameters, controller context, and action filters.
protected virtual ActionExecutedContext InvokeActionMethodWithFilters(ControllerContext controllerContext, IList<IActionFilter> filters, ActionDescriptor actionDescriptor, IDictionary<string, object> parameters)
Parameters
controllerContext
ControllerContextThe controller context.
filters
IList<IActionFilter>The action filters.
actionDescriptor
ActionDescriptorThe action descriptor.
parameters
IDictionary<string, object>The parameters.
Returns
- ActionExecutedContext
The context for the ActionExecuted method of the ActionFilterAttribute class.
InvokeActionResult(ControllerContext, ActionResult)
Invokes the specified action result by using the specified controller context.
protected virtual void InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
Parameters
controllerContext
ControllerContextThe controller context.
actionResult
ActionResultThe action result.
InvokeActionResultWithFilters(ControllerContext, IList<IResultFilter>, ActionResult)
Invokes the specified action result by using the specified action filters and the controller context.
protected virtual ResultExecutedContext InvokeActionResultWithFilters(ControllerContext controllerContext, IList<IResultFilter> filters, ActionResult actionResult)
Parameters
controllerContext
ControllerContextThe controller context.
filters
IList<IResultFilter>The action filters.
actionResult
ActionResultThe action result.
Returns
- ResultExecutedContext
The context for the ResultExecuted method of the ActionFilterAttribute class.
InvokeAuthenticationFilters(ControllerContext, IList<IAuthenticationFilter>, ActionDescriptor)
protected virtual AuthenticationContext InvokeAuthenticationFilters(ControllerContext controllerContext, IList<IAuthenticationFilter> filters, ActionDescriptor actionDescriptor)
Parameters
controllerContext
ControllerContextfilters
IList<IAuthenticationFilter>actionDescriptor
ActionDescriptor
Returns
InvokeAuthenticationFiltersChallenge(ControllerContext, IList<IAuthenticationFilter>, ActionDescriptor, ActionResult)
protected virtual AuthenticationChallengeContext InvokeAuthenticationFiltersChallenge(ControllerContext controllerContext, IList<IAuthenticationFilter> filters, ActionDescriptor actionDescriptor, ActionResult result)
Parameters
controllerContext
ControllerContextfilters
IList<IAuthenticationFilter>actionDescriptor
ActionDescriptorresult
ActionResult
Returns
InvokeAuthorizationFilters(ControllerContext, IList<IAuthorizationFilter>, ActionDescriptor)
Invokes the specified authorization filters by using the specified action descriptor and controller context.
protected virtual AuthorizationContext InvokeAuthorizationFilters(ControllerContext controllerContext, IList<IAuthorizationFilter> filters, ActionDescriptor actionDescriptor)
Parameters
controllerContext
ControllerContextThe controller context.
filters
IList<IAuthorizationFilter>The authorization filters.
actionDescriptor
ActionDescriptorThe action descriptor.
Returns
- AuthorizationContext
The context for the AuthorizeAttribute object.
InvokeExceptionFilters(ControllerContext, IList<IExceptionFilter>, Exception)
Invokes the specified exception filters by using the specified exception and controller context.
protected virtual ExceptionContext InvokeExceptionFilters(ControllerContext controllerContext, IList<IExceptionFilter> filters, Exception exception)
Parameters
controllerContext
ControllerContextThe controller context.
filters
IList<IExceptionFilter>The exception filters.
exception
ExceptionThe exception.
Returns
- ExceptionContext
The context for the HandleErrorAttribute object.