Skip to content

Why is ODataRoutePrefix necessary? #209

Closed
@bdebaere

Description

@bdebaere

Hi,

I was wondering why ODataRoutePrefix is necessary when using versioning for OData. Can't this value be determined by convention?

I have two controllers like below, version 1 and version 2.

[ApiVersion("1.0")]
[ODataRoutePrefix("Customers")]
public class CustomersController : ODataController
{
}

When I remove the ODataRoutePrefix line, the code no longer works. With the following error which doesn't even seem related.
The path template '({key})' on the action 'Get' in controller 'Customers' is not a valid OData path template. Empty segment encountered in request URL. Please make sure that a valid request URL is specified.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions