Share via


HttpRouteCollectionExtensions.MapHttpRoute Method

 

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

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static MapHttpRoute(HttpRouteCollection, String, String)

Maps the specified route template.

System_CAPS_pubmethodSystem_CAPS_static MapHttpRoute(HttpRouteCollection, String, String, Object)

Maps the specified route template and sets default route values.

System_CAPS_pubmethodSystem_CAPS_static MapHttpRoute(HttpRouteCollection, String, String, Object, Object)

Maps the specified route template and sets default route values and constraints.

System_CAPS_pubmethodSystem_CAPS_static MapHttpRoute(HttpRouteCollection, String, String, Object, Object, HttpMessageHandler)

Maps the specified route template and sets default route values, constraints, and end-point message handler.

See Also

HttpRouteCollectionExtensions Class
System.Web.Http Namespace

Return to top

HttpRouteCollectionExtensions.MapHttpRoute Method (HttpRouteCollection, String, String)

Maps the specified route template.

Syntax

public static IHttpRoute MapHttpRoute(
    this HttpRouteCollection routes,
    string name,
    string routeTemplate
)
public:
[ExtensionAttribute]
static IHttpRoute^ MapHttpRoute(
    HttpRouteCollection^ routes,
    String^ name,
    String^ routeTemplate
)
static member MapHttpRoute : 
        routes:HttpRouteCollection *
        name:string *
        routeTemplate:string -> IHttpRoute
<ExtensionAttribute>
Public Shared Function MapHttpRoute (
    routes As HttpRouteCollection,
    name As String,
    routeTemplate As String
) As IHttpRoute

Parameters

  • routeTemplate
    Type: System.String

    The route template for the route.

Return Value

Type: System.Web.Http.Routing.IHttpRoute

A reference to the mapped route.

Return to top

HttpRouteCollectionExtensions.MapHttpRoute Method (HttpRouteCollection, String, String, Object)

Maps the specified route template and sets default route values.

Syntax

public static IHttpRoute MapHttpRoute(
    this HttpRouteCollection routes,
    string name,
    string routeTemplate,
    object defaults
)
public:
[ExtensionAttribute]
static IHttpRoute^ MapHttpRoute(
    HttpRouteCollection^ routes,
    String^ name,
    String^ routeTemplate,
    Object^ defaults
)
static member MapHttpRoute : 
        routes:HttpRouteCollection *
        name:string *
        routeTemplate:string *
        defaults:Object -> IHttpRoute
<ExtensionAttribute>
Public Shared Function MapHttpRoute (
    routes As HttpRouteCollection,
    name As String,
    routeTemplate As String,
    defaults As Object
) As IHttpRoute

Parameters

  • routeTemplate
    Type: System.String

    The route template for the route.

  • defaults
    Type: System.Object

    An object that contains default route values.

Return Value

Type: System.Web.Http.Routing.IHttpRoute

A reference to the mapped route.

Return to top

HttpRouteCollectionExtensions.MapHttpRoute Method (HttpRouteCollection, String, String, Object, Object)

Maps the specified route template and sets default route values and constraints.

Syntax

public static IHttpRoute MapHttpRoute(
    this HttpRouteCollection routes,
    string name,
    string routeTemplate,
    object defaults,
    object constraints
)
public:
[ExtensionAttribute]
static IHttpRoute^ MapHttpRoute(
    HttpRouteCollection^ routes,
    String^ name,
    String^ routeTemplate,
    Object^ defaults,
    Object^ constraints
)
static member MapHttpRoute : 
        routes:HttpRouteCollection *
        name:string *
        routeTemplate:string *
        defaults:Object *
        constraints:Object -> IHttpRoute
<ExtensionAttribute>
Public Shared Function MapHttpRoute (
    routes As HttpRouteCollection,
    name As String,
    routeTemplate As String,
    defaults As Object,
    constraints As Object
) As IHttpRoute

Parameters

  • routeTemplate
    Type: System.String

    The route template for the route.

  • defaults
    Type: System.Object

    An object that contains default route values.

  • constraints
    Type: System.Object

    A set of expressions that specify values for routeTemplate.

Return Value

Type: System.Web.Http.Routing.IHttpRoute

A reference to the mapped route.

Return to top

HttpRouteCollectionExtensions.MapHttpRoute Method (HttpRouteCollection, String, String, Object, Object, HttpMessageHandler)

Maps the specified route template and sets default route values, constraints, and end-point message handler.

Syntax

public static IHttpRoute MapHttpRoute(
    this HttpRouteCollection routes,
    string name,
    string routeTemplate,
    object defaults,
    object constraints,
    HttpMessageHandler handler
)
public:
[ExtensionAttribute]
static IHttpRoute^ MapHttpRoute(
    HttpRouteCollection^ routes,
    String^ name,
    String^ routeTemplate,
    Object^ defaults,
    Object^ constraints,
    HttpMessageHandler^ handler
)
static member MapHttpRoute : 
        routes:HttpRouteCollection *
        name:string *
        routeTemplate:string *
        defaults:Object *
        constraints:Object *
        handler:HttpMessageHandler -> IHttpRoute
<ExtensionAttribute>
Public Shared Function MapHttpRoute (
    routes As HttpRouteCollection,
    name As String,
    routeTemplate As String,
    defaults As Object,
    constraints As Object,
    handler As HttpMessageHandler
) As IHttpRoute

Parameters

  • routeTemplate
    Type: System.String

    The route template for the route.

  • defaults
    Type: System.Object

    An object that contains default route values.

  • constraints
    Type: System.Object

    A set of expressions that specify values for routeTemplate.

Return Value

Type: System.Web.Http.Routing.IHttpRoute

A reference to the mapped route.

Return to top