Class ActionNameAttribute
Represents an attribute that is used for the name of an action.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class ActionNameAttribute : ActionNameSelectorAttribute
- Inheritance
-
ActionNameAttribute
- Inherited Members
Constructors
ActionNameAttribute(string)
Initializes a new instance of the ActionNameAttribute class.
public ActionNameAttribute(string name)
Parameters
namestringName of the action.
Exceptions
- ArgumentException
The
nameparameter is null or empty.
Properties
Name
Gets or sets the name of the action.
public string Name { get; }
Property Value
- string
The name of the action.
Methods
IsValidName(ControllerContext, string, MethodInfo)
Determines whether the action name is valid within the specified controller context.
public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo)
Parameters
controllerContextControllerContextThe controller context.
actionNamestringThe name of the action.
methodInfoMethodInfoInformation about the action method.
Returns
- bool
true if the action name is valid within the specified controller context; otherwise, false.