ODataHttpRouteCollectionExtensions.MapODataRoute Method (HttpRouteCollection, String, String, IEdmModel, IODataPathHandler, IEnumerable<IODataRoutingConvention>)
Maps the specified OData route.
Namespace: System.Web.Http
Assembly: System.Web.Http.OData (in System.Web.Http.OData.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Sub MapODataRoute ( _
routes As HttpRouteCollection, _
routeName As String, _
routePrefix As String, _
model As IEdmModel, _
pathHandler As IODataPathHandler, _
routingConventions As IEnumerable(Of IODataRoutingConvention) _
)
'Usage
Dim routes As HttpRouteCollection
Dim routeName As String
Dim routePrefix As String
Dim model As IEdmModel
Dim pathHandler As IODataPathHandler
Dim routingConventions As IEnumerable(Of IODataRoutingConvention)
routes.MapODataRoute(routeName, routePrefix, _
model, pathHandler, routingConventions)
public static void MapODataRoute(
this HttpRouteCollection routes,
string routeName,
string routePrefix,
IEdmModel model,
IODataPathHandler pathHandler,
IEnumerable<IODataRoutingConvention> routingConventions
)
[ExtensionAttribute]
public:
static void MapODataRoute(
HttpRouteCollection^ routes,
String^ routeName,
String^ routePrefix,
IEdmModel^ model,
IODataPathHandler^ pathHandler,
IEnumerable<IODataRoutingConvention^>^ routingConventions
)
static member MapODataRoute :
routes:HttpRouteCollection *
routeName:string *
routePrefix:string *
model:IEdmModel *
pathHandler:IODataPathHandler *
routingConventions:IEnumerable<IODataRoutingConvention> -> unit
public static function MapODataRoute(
routes : HttpRouteCollection,
routeName : String,
routePrefix : String,
model : IEdmModel,
pathHandler : IODataPathHandler,
routingConventions : IEnumerable<IODataRoutingConvention>
)
Parameters
- routes
Type: System.Web.Http.HttpRouteCollection
A collection of routes for the application.
- routeName
Type: System.String
The name of the route to map.
- routePrefix
Type: System.String
The prefix to add to the OData route's path template.
- model
Type: IEdmModel
The EDM model to use for parsing OData paths.
- pathHandler
Type: System.Web.Http.OData.Routing.IODataPathHandler
The IODataPathHandler to use for parsing the OData path.
- routingConventions
Type: System.Collections.Generic.IEnumerable<IODataRoutingConvention>
The OData routing conventions to use for controller and action selection.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type HttpRouteCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.111) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.111).