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
constraintResolverIInlineConstraintResolverThe 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
routeTemplatestringThe tokenized route template for the route.
allowedMethodsIEnumerable<string>The HTTP methods supported by the route. A null value specify that all possible methods are supported.
controllerNamestringThe name of the associated controller.
actionNamestringThe name of the associated action.
targetMethodMethodInfoThe method that the route attribute has been applied on.
areaNamestring
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
routeTemplatestringThe tokenized route template for the route.
controllerDescriptorControllerDescriptorThe 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
defaultsRouteValueDictionaryThe route defaults.
constraintsRouteValueDictionaryThe route constraints.
dataTokensRouteValueDictionaryrouteTemplatestringThe detokenized route template.
targetMethodMethodInfoThe method that the route attribute has been applied on.
Returns
- Route
The generated System.Web.Routing.Route.