Partager via


HttpRouteCollection.CreateRoute Method (String, IDictionary<String, Object>, IDictionary<String, Object>, IDictionary<String, 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 IDictionary(Of String, Object), _
    constraints As IDictionary(Of String, Object), _
    dataTokens As IDictionary(Of String, Object) _
) As IHttpRoute
'Usage
Dim instance As HttpRouteCollection 
Dim routeTemplate As String 
Dim defaults As IDictionary(Of String, Object)
Dim constraints As IDictionary(Of String, Object)
Dim dataTokens As IDictionary(Of String, Object)
Dim returnValue As IHttpRoute 

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

Parameters

Return Value

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

See Also

Reference

HttpRouteCollection Class

CreateRoute Overload

System.Web.Http Namespace