HttpActionDescriptorExtensions

Namespace: ASPSecurityKit.NetFramework.WebApi
Assembly: ASPSecurityKit.NetFramework.WebApi.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.Http.Controllers.HttpActionDescriptor 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,inherit)

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.Http.Controllers.HttpActionDescriptor 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.

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.Http.Controllers.HttpActionDescriptor The action descriptor.