Class ReflectedControllerDescriptor
Contains information that describes a reflected controller.
public class ReflectedControllerDescriptor : ControllerDescriptor, ICustomAttributeProvider
- Inheritance
-
ReflectedControllerDescriptor
- Implements
- Inherited Members
Constructors
ReflectedControllerDescriptor(Type)
Initializes a new instance of the ReflectedControllerDescriptor class.
public ReflectedControllerDescriptor(Type controllerType)
Parameters
controllerType
TypeThe type of the controller.
Exceptions
- ArgumentNullException
The
controllerType
parameter is null.
Properties
ControllerType
Gets the type of the controller.
public override sealed Type ControllerType { get; }
Property Value
- Type
The type of the controller.
Methods
FindAction(ControllerContext, string)
Finds the specified action for the specified controller context.
public override ActionDescriptor FindAction(ControllerContext controllerContext, string actionName)
Parameters
controllerContext
ControllerContextThe controller context.
actionName
stringThe name of the action.
Returns
- ActionDescriptor
The information about the action.
Exceptions
- ArgumentNullException
The
controllerContext
parameter is null.- ArgumentException
The
actionName
parameter is null or empty.
GetCanonicalActions()
Returns the list of actions for the controller.
public override ActionDescriptor[] GetCanonicalActions()
Returns
- ActionDescriptor[]
A list of action descriptors for the controller.
GetCustomAttributes(bool)
Returns an array of custom attributes that are defined for this member, excluding named attributes.
public override object[] GetCustomAttributes(bool inherit)
Parameters
inherit
booltrue 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 that are defined for this member, identified by type.
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
attributeType
TypeThe type of the custom attributes.
inherit
booltrue 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
booltrue to use the cache, otherwise false.
Returns
- IEnumerable<FilterAttribute>
The filter attributes.
IsDefined(Type, bool)
Returns a value that 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
TypeThe type of the custom attributes.
inherit
booltrue 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.