using latest nightly of System.Web.Http.OData. using ODataConventionModelBuilder() and EnableOData() with Entity Framework.
When using a string as the key, links are generated as follows:
~/Entities
~/Entities('key')
and that's fine. However, when you try and use a navigation property, the link is as follows:
~/Entities('key')/NavigationProperty
and the string that is passed through to the controller action is "'key'" - it is wrapped in in the single quotes. this gets passed down to EF, (WHERE blah='''key''') and of course the query returns no results.
The quotes are removed correctly when looking at an individual entity ~/Entities/('key') it seems, so there appears to be an oversight in the deserialization.
When using a string as the key, links are generated as follows:
~/Entities
~/Entities('key')
and that's fine. However, when you try and use a navigation property, the link is as follows:
~/Entities('key')/NavigationProperty
and the string that is passed through to the controller action is "'key'" - it is wrapped in in the single quotes. this gets passed down to EF, (WHERE blah='''key''') and of course the query returns no results.
The quotes are removed correctly when looking at an individual entity ~/Entities/('key') it seems, so there appears to be an oversight in the deserialization.