RouteValueAttribute Class
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.
An attribute which specifies a required route value for an action or controller.
When placed on an action, the route data of a request must match the expectations of the required route data in order for the action to be selected. All other actions without a route value for the given key cannot be selected unless the route data of the request does omits a value matching the key. See IRouteValueProvider for more details and examples.
When placed on a controller, unless overridden by the action, the constraint applies to all actions defined by the controller.
public ref class RouteValueAttribute abstract : Attribute, Microsoft::AspNetCore::Mvc::Routing::IRouteValueProvider
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public abstract class RouteValueAttribute : Attribute, Microsoft.AspNetCore.Mvc.Routing.IRouteValueProvider
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type RouteValueAttribute = class
inherit Attribute
interface IRouteValueProvider
Public MustInherit Class RouteValueAttribute
Inherits Attribute
Implements IRouteValueProvider
- Inheritance
-
RouteValueAttribute
- Derived
- Attributes
- Implements
Route |
Creates a new RouteValueAttribute. |
Route |
The route value key. |
Route |
The route value. If |
Product | Versions |
---|---|
ASP.NET Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |