Class ReflectedAsyncActionDescriptor
Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters.
public class ReflectedAsyncActionDescriptor : AsyncActionDescriptor, ICustomAttributeProvider, IMethodInfoActionDescriptor
- Inheritance
-
ReflectedAsyncActionDescriptor
- Implements
- Inherited Members
Constructors
ReflectedAsyncActionDescriptor(MethodInfo, MethodInfo, string, ControllerDescriptor)
Initializes a new instance of the ReflectedAsyncActionDescriptor class.
public ReflectedAsyncActionDescriptor(MethodInfo asyncMethodInfo, MethodInfo completedMethodInfo, string actionName, ControllerDescriptor controllerDescriptor)
Parameters
asyncMethodInfo
MethodInfoAn object that contains information about the method that begins the asynchronous operation (the method whose name ends with "Asynch").
completedMethodInfo
MethodInfoAn object that contains information about the completion method (method whose name ends with "Completed").
actionName
stringThe name of the action.
controllerDescriptor
ControllerDescriptorThe controller descriptor.
Properties
ActionName
Gets the name of the action method.
public override string ActionName { get; }
Property Value
- string
The name of the action method.
AsyncMethodInfo
Gets the method information for the asynchronous action method.
public MethodInfo AsyncMethodInfo { get; }
Property Value
- MethodInfo
The method information for the asynchronous action method.
CompletedMethodInfo
Gets the method information for the asynchronous completion method.
public MethodInfo CompletedMethodInfo { get; }
Property Value
- MethodInfo
The method information for the asynchronous completion method.
ControllerDescriptor
Gets the controller descriptor for the asynchronous action method.
public override ControllerDescriptor ControllerDescriptor { get; }
Property Value
- ControllerDescriptor
The controller descriptor for the asynchronous action method.
MethodInfo
Gets the MethodInfo
public MethodInfo MethodInfo { get; }
Property Value
UniqueId
Gets the lazy initialized unique ID of the instance of this class.
public override string UniqueId { get; }
Property Value
- string
The lazy initialized unique ID of the instance of this class.
Methods
BeginExecute(ControllerContext, IDictionary<string, object>, AsyncCallback, object)
Begins running the asynchronous action method by using the specified parameters and controller context.
public override IAsyncResult BeginExecute(ControllerContext controllerContext, IDictionary<string, object> parameters, AsyncCallback callback, object state)
Parameters
controllerContext
ControllerContextThe controller context.
parameters
IDictionary<string, object>The parameters of the action method.
callback
AsyncCallbackThe callback method.
state
objectAn object that contains information to be used by the callback method. This parameter can be null.
Returns
- IAsyncResult
An object that contains the result of an asynchronous call.
EndExecute(IAsyncResult)
Returns the result of an asynchronous operation.
public override object EndExecute(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn object that represents the status of an asynchronous operation.
Returns
- object
The result of an asynchronous operation.
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.
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 to return.
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 of the specified type exist.
GetFilterAttributes(bool)
Gets the filter attributes.
public override IEnumerable<FilterAttribute> GetFilterAttributes(bool useCache)
Parameters
useCache
boolUse cache flag.
Returns
- IEnumerable<FilterAttribute>
The filter attributes.
GetParameters()
Returns the parameters of the action method.
public override ParameterDescriptor[] GetParameters()
Returns
- ParameterDescriptor[]
The parameters of the action method.
GetSelectors()
Returns the action-method selectors.
public override ICollection<ActionSelector> GetSelectors()
Returns
- ICollection<ActionSelector>
The action-method selectors.
IsDefined(Type, bool)
Determines whether one or more instances of the specified attribute type are defined for the action member.
public override bool IsDefined(Type attributeType, bool inherit)
Parameters
attributeType
TypeThe type of the custom attribute.
inherit
booltrue to look up the hierarchy chain for the inherited custom attribute; otherwise, false.
Returns
- bool
true if an attribute of type that is represented by
attributeType
is defined for this member; otherwise, false.