ActionDescriptorExtensions

Namespace: ASPSecurityKit.NetFramework.Mvc
Assembly: ASPSecurityKit.NetFramework.Mvc.dll

Summary

Provides extension methods for action/controller Descriptors.

Methods

IsDefinedOnActionOrController<T>(actionDescriptor,inherit)

Summary

Determines whether the given attribute is defined for the specified action or its controller. The one on action will get precedence.

Returns

true if the given attribute is defined for the specified action or its controller; otherwise, false.

Parameters
Name Type Description
actionDescriptor System.Web.Mvc.ActionDescriptor The action descriptor.
inherit System.Boolean Indicates whether to consider inherited attributes as well.
Generic Types
Name Description
T Type of the attribute to search for.

GetCustomAttributeFromActionOrController<T>(actionDescriptor,inherited)

Summary

Gets the first instance of the given attribute if it is defined for the specified action or its controller. The one on action will get precedence.

Returns

The first instance of the given attribute if it is defined for the specified action or its controller; otherwise, null.

Parameters
Name Type Description
actionDescriptor System.Web.Mvc.ActionDescriptor The action descriptor.
inherited System.Boolean Indicates whether to consider inherited attributes as well.
Generic Types
Name Description
T Type of the attribute to search for.

GetOperationName(actionDescriptor)

Summary

Gets the name of the operation from the specified action metadata.

Returns

The name of the operation from the specified action metadata.

Parameters
Name Type Description
actionDescriptor System.Web.Mvc.ActionDescriptor The action descriptor.

GetActionReturnType(actionDescriptor)

Summary

Gets the return type of the operation from the specified action metadata.

Returns

The return type of the operation from the specified action metadata.

Parameters
Name Type Description
actionDescriptor System.Web.Mvc.ActionDescriptor The action descriptor.