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 Overridable Function CreateRoute ( _
    routeTemplate As String, _
    defaults As IDictionary(Of String, Object), _
    constraints As IDictionary(Of String, Object), _
    dataTokens As IDictionary(Of String, Object), _
    handler As HttpMessageHandler _
) 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 handler As HttpMessageHandler 
Dim returnValue As IHttpRoute 

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

Parameters

  • handler
    Type: HttpMessageHandler

    The message handler for the route.

Return Value

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

See Also

Reference

HttpRouteCollection Class

CreateRoute Overload

System.Web.Http Namespace