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
controllerTypeTypeThe type of the controller.
Exceptions
- ArgumentNullException
The
controllerTypeparameter 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
controllerContextControllerContextThe controller context.
actionNamestringThe name of the action.
Returns
- ActionDescriptor
The information about the action.
Exceptions
- ArgumentNullException
The
controllerContextparameter is null.- ArgumentException
The
actionNameparameter 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
inheritbooltrue 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
attributeTypedefined 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
attributeTypeTypeThe type of the custom attributes.
inheritbooltrue 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
attributeTypedefined for this member.
GetFilterAttributes(bool)
Gets the filter attributes.
public override IEnumerable<FilterAttribute> GetFilterAttributes(bool useCache)
Parameters
useCachebooltrue 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
attributeTypeTypeThe type of the custom attributes.
inheritbooltrue 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.