Table of Contents

Class RouteBuilder

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

Builds System.Web.Routing.Route instances based on route information.

[Obsolete("Obsolete, do not use. To create custom Routes with attribute routing, use System.Web.Mvc.Routing.RouteFactoryAttribute")]
public class RouteBuilder
Inheritance
RouteBuilder
Inherited Members

Constructors

RouteBuilder()

Initializes a new instance of the RouteBuilder class using the default inline constraint resolver.

public RouteBuilder()

RouteBuilder(IInlineConstraintResolver)

Initializes a new instance of the RouteBuilder class.

public RouteBuilder(IInlineConstraintResolver constraintResolver)

Parameters

constraintResolver IInlineConstraintResolver

The IInlineConstraintResolver to use for resolving inline constraints.

Properties

ConstraintResolver

Gets the resolver for resolving inline constraints.

public IInlineConstraintResolver ConstraintResolver { get; }

Property Value

IInlineConstraintResolver

The resolver for resolving inline constraints.

Methods

BuildDirectRoute(string, IEnumerable<string>, string, string, MethodInfo, string)

Builds an System.Web.Routing.Route for a particular action.

public Route BuildDirectRoute(string routeTemplate, IEnumerable<string> allowedMethods, string controllerName, string actionName, MethodInfo targetMethod, string areaName)

Parameters

routeTemplate string

The tokenized route template for the route.

allowedMethods IEnumerable<string>

The HTTP methods supported by the route. A null value specify that all possible methods are supported.

controllerName string

The name of the associated controller.

actionName string

The name of the associated action.

targetMethod MethodInfo

The method that the route attribute has been applied on.

areaName string

Returns

Route

The generated System.Web.Routing.Route.

BuildDirectRoute(string, ControllerDescriptor)

Builds an System.Web.Routing.Route for a particular action.

public Route BuildDirectRoute(string routeTemplate, ControllerDescriptor controllerDescriptor)

Parameters

routeTemplate string

The tokenized route template for the route.

controllerDescriptor ControllerDescriptor

The controller the route attribute has been applied on.

Returns

Route

The generated route.

BuildDirectRoute(RouteValueDictionary, RouteValueDictionary, RouteValueDictionary, string, MethodInfo)

Builds an System.Web.Routing.Route.

public virtual Route BuildDirectRoute(RouteValueDictionary defaults, RouteValueDictionary constraints, RouteValueDictionary dataTokens, string routeTemplate, MethodInfo targetMethod)

Parameters

defaults RouteValueDictionary

The route defaults.

constraints RouteValueDictionary

The route constraints.

dataTokens RouteValueDictionary
routeTemplate string

The detokenized route template.

targetMethod MethodInfo

The method that the route attribute has been applied on.

Returns

Route

The generated System.Web.Routing.Route.