Partager via


HttpRouteCollection.CreateRoute Method (String, Object, Object)

Creates an IHttpRoute instance.

Namespace:  System.Web.Http
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Public Function CreateRoute ( _
    routeTemplate As String, _
    defaults As Object, _
    constraints As Object _
) As IHttpRoute
'Usage
Dim instance As HttpRouteCollection 
Dim routeTemplate As String 
Dim defaults As Object 
Dim constraints As Object 
Dim returnValue As IHttpRoute 

returnValue = instance.CreateRoute(routeTemplate, _
    defaults, constraints)
public IHttpRoute CreateRoute(
    string routeTemplate,
    Object defaults,
    Object constraints
)
public:
IHttpRoute^ CreateRoute(
    String^ routeTemplate, 
    Object^ defaults, 
    Object^ constraints
)
member CreateRoute : 
        routeTemplate:string * 
        defaults:Object * 
        constraints:Object -> IHttpRoute
public function CreateRoute(
    routeTemplate : String, 
    defaults : Object, 
    constraints : Object
) : IHttpRoute

Parameters

  • defaults
    Type: System.Object

    An object that contains the default route parameters.

  • constraints
    Type: System.Object

    An object that contains the route constraints.

Return Value

Type: System.Web.Http.Routing.IHttpRoute
The new IHttpRoute instance.

See Also

Reference

HttpRouteCollection Class

CreateRoute Overload

System.Web.Http Namespace