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
name
stringName of the action.
Exceptions
- ArgumentException
The
name
parameter 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
controllerContext
ControllerContextThe controller context.
actionName
stringThe name of the action.
methodInfo
MethodInfoInformation about the action method.
Returns
- bool
true if the action name is valid within the specified controller context; otherwise, false.