Question

I've seen Missing inverse property in asp.net webapi odata $metadata and the WebAPI $metadata I'm dealing with behaves as described in this article: it doesn't reuse associations for bi-directional navigation properties.

When using jaysvcutil 1.3.5 all navigational properties come up as $$unbound.

$data.Entity.extend('API.Models.Document', {
    ... 
    'Document_Versions': {        
        'type':'Array',
        'elementType':'API.Models.Document_Versions',
        'inverseProperty':'$$unbound' }
});

Other than manually updating the inverseProperty information is there anything to get the desired result automatically?

Update based on @Robesz answer Manually adding inverseProperty information to the static .js converted by JaySvcUtil is doable, but I'm asking if there's an option to accomplish that with the dynamic conversion as well.

There seems to be to options

  1. make modifications to the .NET WebAPI. Might be challenging, because their seem to be good reason for their implementation, but maybe somebody already successfully did that.
  2. modifying the conversion XSLT that JayData using to take that behavior into account.
Was it helpful?

Solution 2

This should be most probably handled by extending JayData's XSLT conversion. I've created an issues for that on https://github.com/jaydata/jaydata/issues/155.

OTHER TIPS

We've just arrived to the same results with WebAPI OData, but after editing the generated context file manually and adding the inverseProperty everything is working fine

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top