ActionResultStatusCodeAttribute Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attribute annotated on ActionResult constructor and helper method parameters to indicate that the parameter is used to set the "statusCode" for the ActionResult.
Analyzers match this parameter by type name. This allows users to annotate custom results \ custom helpers with a user-defined attribute without having to expose this type.
This attribute is intentionally marked Inherited=false since the analyzer does not walk the inheritance graph.
public ref class ActionResultStatusCodeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)]
public sealed class ActionResultStatusCodeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)>]
type ActionResultStatusCodeAttribute = class
inherit Attribute
Public NotInheritable Class ActionResultStatusCodeAttribute
Inherits Attribute
- Inheritance
-
ActionResultStatusCodeAttribute
- Attributes
Examples
Annotated constructor parameter:
public StatusCodeResult([ActionResultStatusCode] int statusCode)
{
StatusCode = statusCode;
}
Constructors
ActionResultStatusCodeAttribute() |