ActionContext Class

Context object for execution of action which has been selected as part of an HTTP request.

Namespace
Microsoft.AspNetCore.Mvc
Assemblies
  • Microsoft.AspNetCore.Mvc.Abstractions

Syntax

public class ActionContext
class Microsoft.AspNetCore.Mvc.ActionContext

Constructors

ActionContext()

Creates an empty Microsoft.AspNetCore.Mvc.ActionContext.

public ActionContext()
ActionContext(Microsoft.AspNetCore.Http.HttpContext, Microsoft.AspNetCore.Routing.RouteData, Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor)

Creates a new Microsoft.AspNetCore.Mvc.ActionContext.

Arguments:
public ActionContext(HttpContext httpContext, RouteData routeData, ActionDescriptor actionDescriptor)
ActionContext(Microsoft.AspNetCore.Http.HttpContext, Microsoft.AspNetCore.Routing.RouteData, Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary)

Creates a new Microsoft.AspNetCore.Mvc.ActionContext.

Arguments:
public ActionContext(HttpContext httpContext, RouteData routeData, ActionDescriptor actionDescriptor, ModelStateDictionary modelState)
ActionContext(Microsoft.AspNetCore.Mvc.ActionContext)

Creates a new Microsoft.AspNetCore.Mvc.ActionContext.

Arguments:actionContext (Microsoft.AspNetCore.Mvc.ActionContext) – The Microsoft.AspNetCore.Mvc.ActionContext to copy.
public ActionContext(ActionContext actionContext)

Properties

Microsoft.AspNetCore.Mvc.ActionContext.ActionDescriptor

Gets or sets the Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor for the selected action.

Return type:Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor
public ActionDescriptor ActionDescriptor { get; set; }
Microsoft.AspNetCore.Mvc.ActionContext.HttpContext

Gets or sets the Microsoft.AspNetCore.Http.HttpContext for the current request.

Return type:Microsoft.AspNetCore.Http.HttpContext
public HttpContext HttpContext { get; set; }
Microsoft.AspNetCore.Mvc.ActionContext.ModelState

Gets the Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.

Return type:Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary
public ModelStateDictionary ModelState { get; }
Microsoft.AspNetCore.Mvc.ActionContext.RouteData

Gets or sets the Microsoft.AspNetCore.Routing.RouteData for the current request.

Return type:Microsoft.AspNetCore.Routing.RouteData
public RouteData RouteData { get; set; }