Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HttpRouteCollectionExtensions::MapHttpRoute Method

 

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticMapHttpRoute(HttpRouteCollection^, String^, String^)

Maps the specified route template.

System_CAPS_pubmethodSystem_CAPS_staticMapHttpRoute(HttpRouteCollection^, String^, String^, Object^)

Maps the specified route template and sets default route values.

System_CAPS_pubmethodSystem_CAPS_staticMapHttpRoute(HttpRouteCollection^, String^, String^, Object^, Object^)

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

System_CAPS_pubmethodSystem_CAPS_staticMapHttpRoute(HttpRouteCollection^, String^, String^, Object^, Object^, HttpMessageHandler^)

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

Return to top

HttpRouteCollectionExtensions::MapHttpRoute Method (HttpRouteCollection^, String^, String^)

Maps the specified route template.

public:
[ExtensionAttribute]
static IHttpRoute^ MapHttpRoute(
	HttpRouteCollection^ routes,
	String^ name,
	String^ routeTemplate
)

Parameters

routes
Type: System.Web.Http::HttpRouteCollection^

A collection of routes for the application.

name
Type: System::String^

The name of the route to map.

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.

public:
[ExtensionAttribute]
static IHttpRoute^ MapHttpRoute(
	HttpRouteCollection^ routes,
	String^ name,
	String^ routeTemplate,
	Object^ defaults
)

Parameters

routes
Type: System.Web.Http::HttpRouteCollection^

A collection of routes for the application.

name
Type: System::String^

The name of the route to map.

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.

public:
[ExtensionAttribute]
static IHttpRoute^ MapHttpRoute(
	HttpRouteCollection^ routes,
	String^ name,
	String^ routeTemplate,
	Object^ defaults,
	Object^ constraints
)

Parameters

routes
Type: System.Web.Http::HttpRouteCollection^

A collection of routes for the application.

name
Type: System::String^

The name of the route to map.

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.

public:
[ExtensionAttribute]
static IHttpRoute^ MapHttpRoute(
	HttpRouteCollection^ routes,
	String^ name,
	String^ routeTemplate,
	Object^ defaults,
	Object^ constraints,
	HttpMessageHandler^ handler
)

Parameters

routes
Type: System.Web.Http::HttpRouteCollection^

A collection of routes for the application.

name
Type: System::String^

The name of the route to map.

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.

handler
Type: System.Net.Http::HttpMessageHandler^

The handler to which the request will be dispatched.

Return Value

Type: System.Web.Http.Routing::IHttpRoute^

A reference to the mapped route.

Return to top
Show: