entityrepository / ODataServer

Enhances Web API OData functionality, featuring generic OData controllers that can be generated from a domain model, including any Entity Framework DbContext.
15 stars 4 forks source link

Server does not correctly handle link URLs with subpaths #11

Open johncrim opened 9 years ago

johncrim commented 9 years ago

(originally http://entityrepository.codeplex.com/workitem/16)

When parsing link URLs in ParseSingleEntityLink(), ODataServer attempts to match up the link route to it's own route template. This works if the link route looks like this:

http://www.foo.com/odata/SomeEntity(1L)

but it fails when there is as subpath in the route:

http://www.foo.com/bar/odata/SomeEntity(1L)

This is because the route template only contains "odata/{*odataPath}", which doesn't allow for any subpaths in the link route.

johncrim commented 9 years ago

johncrim wrote Jan 15 at 1:36 PM

This is for PUT or $batch requests - presumably it works ok for requests outside $batch, though that would be worth testing, too.

Good catch! With a little work this is unit testable...