Share via


ODataHttpRouteCollectionExtensions.MapODataRoute Method (HttpRouteCollection, String, String, IEdmModel, IODataPathHandler, IEnumerable<IODataRoutingConvention>, ODataBatchHandler)

Maps the specified OData route. When the batchHandler is provided, it will create a 'batch' endpoint to handle the batch requests.

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), _
    batchHandler As ODataBatchHandler _
)
'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)
Dim batchHandler As ODataBatchHandler 

routes.MapODataRoute(routeName, routePrefix, _
    model, pathHandler, routingConventions, _
    batchHandler)
public static void MapODataRoute(
    this HttpRouteCollection routes,
    string routeName,
    string routePrefix,
    IEdmModel model,
    IODataPathHandler pathHandler,
    IEnumerable<IODataRoutingConvention> routingConventions,
    ODataBatchHandler batchHandler
)
[ExtensionAttribute]
public:
static void MapODataRoute(
    HttpRouteCollection^ routes, 
    String^ routeName, 
    String^ routePrefix, 
    IEdmModel^ model, 
    IODataPathHandler^ pathHandler, 
    IEnumerable<IODataRoutingConvention^>^ routingConventions, 
    ODataBatchHandler^ batchHandler
)
static member MapODataRoute : 
        routes:HttpRouteCollection * 
        routeName:string * 
        routePrefix:string * 
        model:IEdmModel * 
        pathHandler:IODataPathHandler * 
        routingConventions:IEnumerable<IODataRoutingConvention> * 
        batchHandler:ODataBatchHandler -> unit
public static function MapODataRoute(
    routes : HttpRouteCollection, 
    routeName : String, 
    routePrefix : String, 
    model : IEdmModel, 
    pathHandler : IODataPathHandler, 
    routingConventions : IEnumerable<IODataRoutingConvention>, 
    batchHandler : ODataBatchHandler
)

Parameters

  • 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.

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).

See Also

Reference

ODataHttpRouteCollectionExtensions Class

MapODataRoute Overload

System.Web.Http Namespace