HttpRouteCollectionExtensions.MapHttpRoute Method
Namespace: System.Web.Http
Assembly: System.Web.Http (in System.Web.Http.dll)
Overload List
Name | Description | |
---|---|---|
MapHttpRoute(HttpRouteCollection, String, String) | Maps the specified route template. |
|
MapHttpRoute(HttpRouteCollection, String, String, Object) | Maps the specified route template and sets default route values. |
|
MapHttpRoute(HttpRouteCollection, String, String, Object, Object) | Maps the specified route template and sets default route values and constraints. |
|
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
routes
Type: System.Web.Http.HttpRouteCollectionA collection of routes for the application.
name
Type: System.StringThe name of the route to map.
routeTemplate
Type: System.StringThe 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
routes
Type: System.Web.Http.HttpRouteCollectionA collection of routes for the application.
name
Type: System.StringThe name of the route to map.
routeTemplate
Type: System.StringThe route template for the route.
defaults
Type: System.ObjectAn 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
routes
Type: System.Web.Http.HttpRouteCollectionA collection of routes for the application.
name
Type: System.StringThe name of the route to map.
routeTemplate
Type: System.StringThe route template for the route.
defaults
Type: System.ObjectAn object that contains default route values.
constraints
Type: System.ObjectA 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
routes
Type: System.Web.Http.HttpRouteCollectionA collection of routes for the application.
name
Type: System.StringThe name of the route to map.
routeTemplate
Type: System.StringThe route template for the route.
defaults
Type: System.ObjectAn object that contains default route values.
constraints
Type: System.ObjectA set of expressions that specify values for routeTemplate.
handler
Type: System.Net.Http.HttpMessageHandlerThe 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