Table of Contents

Class ReflectedActionDescriptor

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Contains information that describes a reflected action method.

public class ReflectedActionDescriptor : ActionDescriptor, ICustomAttributeProvider, IMethodInfoActionDescriptor
Inheritance
ReflectedActionDescriptor
Implements
Inherited Members

Constructors

ReflectedActionDescriptor(MethodInfo, string, ControllerDescriptor)

Initializes a new instance of the ReflectedActionDescriptor class.

public ReflectedActionDescriptor(MethodInfo methodInfo, string actionName, ControllerDescriptor controllerDescriptor)

Parameters

methodInfo MethodInfo

The action-method information.

actionName string

The name of the action.

controllerDescriptor ControllerDescriptor

The controller descriptor.

Exceptions

ArgumentNullException

Either the methodInfo or controllerDescriptor parameter is null.

ArgumentException

The actionName parameter is null or empty.

Properties

ActionName

Gets the name of the action.

public override string ActionName { get; }

Property Value

string

The name of the action.

ControllerDescriptor

Gets the controller descriptor.

public override ControllerDescriptor ControllerDescriptor { get; }

Property Value

ControllerDescriptor

The controller descriptor.

MethodInfo

Gets or sets the action-method information.

public MethodInfo MethodInfo { get; }

Property Value

MethodInfo

The action-method information.

UniqueId

Gets the unique ID for the reflected action descriptor using lazy initialization.

public override string UniqueId { get; }

Property Value

string

The unique ID.

Methods

Execute(ControllerContext, IDictionary<string, object>)

Executes the specified controller context by using the specified action-method parameters.

public override object Execute(ControllerContext controllerContext, IDictionary<string, object> parameters)

Parameters

controllerContext ControllerContext

The controller context.

parameters IDictionary<string, object>

The parameters.

Returns

object

The action return value.

Exceptions

ArgumentNullException

The parameters or controllerContext parameter is null.

GetCustomAttributes(bool)

Returns an array of custom attributes defined for this member, excluding named attributes.

public override object[] GetCustomAttributes(bool inherit)

Parameters

inherit bool

true to look up the hierarchy chain for the inherited custom attribute; otherwise, false.

Returns

object[]

An array of custom attributes, or an empty array if no custom attributes exist.

Exceptions

TypeLoadException

The custom attribute type cannot be loaded.

AmbiguousMatchException

There is more than one attribute of type attributeType defined for this member.

GetCustomAttributes(Type, bool)

Returns an array of custom attributes defined for this member, identified by type.

public override object[] GetCustomAttributes(Type attributeType, bool inherit)

Parameters

attributeType Type

The type of the custom attributes.

inherit bool

true to look up the hierarchy chain for the inherited custom attribute; otherwise, false.

Returns

object[]

An array of custom attributes, or an empty array if no custom attributes exist.

Exceptions

TypeLoadException

The custom attribute type cannot be loaded.

AmbiguousMatchException

There is more than one attribute of type attributeType defined for this member.

GetFilterAttributes(bool)

Gets the filter attributes.

public override IEnumerable<FilterAttribute> GetFilterAttributes(bool useCache)

Parameters

useCache bool

true to use the cache, otherwise false.

Returns

IEnumerable<FilterAttribute>

The filter attributes.

GetParameters()

Retrieves the parameters of the action method.

public override ParameterDescriptor[] GetParameters()

Returns

ParameterDescriptor[]

The parameters of the action method.

GetSelectors()

Retrieves the action selectors.

public override ICollection<ActionSelector> GetSelectors()

Returns

ICollection<ActionSelector>

The action selectors.

IsDefined(Type, bool)

Indicates whether one or more instances of a custom attribute type are defined for this member.

public override bool IsDefined(Type attributeType, bool inherit)

Parameters

attributeType Type

The type of the custom attributes.

inherit bool

true to look up the hierarchy chain for the inherited custom attribute; otherwise, false.

Returns

bool

true if the custom attribute type is defined for this member; otherwise, false.