Share via


RouteAttribute 类

定义

放置在某个控制器或操作上,以通过路由直接将它公开。 放置在控制器上时,将适用于没有放置任何“System.Web.Mvc.RouteAttribute’s”的操作。

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
public sealed class RouteAttribute : Attribute, System.Web.Mvc.Routing.IDirectRouteFactory, System.Web.Mvc.Routing.IRouteInfoProvider
type RouteAttribute = class
    inherit Attribute
    interface IDirectRouteFactory
    interface IRouteInfoProvider
Public NotInheritable Class RouteAttribute
Inherits Attribute
Implements IDirectRouteFactory, IRouteInfoProvider
继承
RouteAttribute
属性
实现

构造函数

RouteAttribute()

初始化 RouteAttribute 类的新实例。

RouteAttribute(String)

使用指定的模板初始化 类的新实例 RouteAttribute

属性

Name

获取或设置路由的名称。

Order

获取路由的应用顺序。

Template

获取路由要匹配的模式。

显式接口实现

IDirectRouteFactory.CreateRoute(DirectRouteFactoryContext)

创建直接路由项。

适用于