RouteAttribute Class

Summary

Specifies an attribute route on a controller.

Syntax

public class RouteAttribute : Attribute, _Attribute, IRouteTemplateProvider

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.RouteAttribute

Constructors

RouteAttribute(System.String)

Creates a new [Microsoft.AspNet.Mvc.RouteAttribute](Microsoft.AspNet.Mvc.RouteAttribute.yml) with the given route template.

Arguments:
  • template (System.String) – The route template. May not be null.
public RouteAttribute(string template)

Properties

Order()
Return type:System.Nullable{System.Int32}
int ? IRouteTemplateProvider.Order { get; }
Name()
Return type:System.String
public string Name { get; set; }
Order()

Gets the route order. The order determines the order of route execution. Routes with a lower order value are tried first. If an action defines a route by providing an [Microsoft.AspNet.Mvc.Routing.IRouteTemplateProvider](Microsoft.AspNet.Mvc.Routing.IRouteTemplateProvider.yml) with a non <c>null</c> order, that order is used instead of this value. If neither the action nor the controller defines an order, a default value of 0 is used.

Return type:System.Int32
public int Order { get; set; }
Template()
Return type:System.String
public string Template { get; }