Class RouteBuilder
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
IInlineConstraintResolverThe 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
stringThe 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
stringThe name of the associated controller.
actionName
stringThe name of the associated action.
targetMethod
MethodInfoThe 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
stringThe tokenized route template for the route.
controllerDescriptor
ControllerDescriptorThe 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
RouteValueDictionaryThe route defaults.
constraints
RouteValueDictionaryThe route constraints.
dataTokens
RouteValueDictionaryrouteTemplate
stringThe detokenized route template.
targetMethod
MethodInfoThe method that the route attribute has been applied on.
Returns
- Route
The generated System.Web.Routing.Route.