asp.net web api2 - odata 4 many-to-many relation ships -
using odatacontroller
in 1 many many or in many-to-many relationship, how can kid of kid entities.
for illustration in odata 4 sample service here:
https://github.com/odata/odatasamples/blob/master/scenarios/trippin/src/webapi/odatasamples.webapiservice/controllers/peoplecontroller.cs
i need know how implement like:
public class peoplecontroller : odatacontroller { ... [odataroute("people({key})/trips/planitems)] public iquerable<planitems> getplanitems([fromodatauri] string key]) }
that means want retrieve planitems person.
unfortunately, methods implement [odataroute("people({key})/trips({tripid})/planitems)]
only
the url convention .../people(key)/trips/planitems
not valid can see error message if seek "the request uri not valid. since segment 'trips' refers collection, must lastly segment in request uri or must followed function or action can bound otherwise intermediate segments must refer single resource." alternative using url .../people(key)/trips?$expand=planitems
odata asp.net-web-api2
No comments:
Post a Comment