Table of Contents

Class RouteFactoryAttribute

Namespace
System.Web.Mvc.Routing
Assembly
System.Web.Mvc.dll

Represents an attribute route that may contain custom constraints.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
public abstract class RouteFactoryAttribute : Attribute, IDirectRouteFactory
Inheritance
RouteFactoryAttribute
Implements
Inherited Members

Constructors

RouteFactoryAttribute(string)

Initializes a new instance of the RouteFactoryAttribute class.

protected RouteFactoryAttribute(string template)

Parameters

template string

The route template.

Properties

Constraints

Gets the route constraints.

public virtual RouteValueDictionary Constraints { get; }

Property Value

RouteValueDictionary

The route constraints, if any; otherwise null.

DataTokens

Gets the route data tokens.

public virtual RouteValueDictionary DataTokens { get; }

Property Value

RouteValueDictionary

The route data tokens, if any; otherwise null.

Defaults

Gets the route defaults.

public virtual RouteValueDictionary Defaults { get; }

Property Value

RouteValueDictionary

The route defaults, if any; otherwise null.

Name

Gets or sets the route name.

public string Name { get; set; }

Property Value

string

The route name, if any; otherwise null.

Order

Gets or sets the route order.

public int Order { get; set; }

Property Value

int

The route order.

Template

Gets the route template.

public string Template { get; }

Property Value

string

The route template.

Methods

CreateRoute(DirectRouteFactoryContext)

Creates a direct route entry.

public RouteEntry CreateRoute(DirectRouteFactoryContext context)

Parameters

context DirectRouteFactoryContext

The context to use to create the route.

Returns

RouteEntry

The direct route entry.