0

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.
Community
  • 1
  • 1
RainerAtSpirit
  • 3,723
  • 1
  • 17
  • 18

2 Answers2

0

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

Robesz
  • 1,646
  • 11
  • 13
  • No I see your problem :) I ask around if somebody is aware of the webapi roadmap. – Robesz Jan 17 '14 at 09:00
  • Can you point me to the correct node version of `jaysvcutil` and the corresponding XSLT that it's using? I found more than one on github, so I'm not sure which one to start with. Thanks. – RainerAtSpirit Jan 21 '14 at 22:14
0

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.

RainerAtSpirit
  • 3,723
  • 1
  • 17
  • 18