Quantcast
Channel: ASP.NET MVC / Web API / Web Pages
Viewing all articles
Browse latest Browse all 7925

New Post: WEB API ODATA - GET on properties

$
0
0
Hi All!

We are having the following problem:
  1. We have an EnrollmentController derived from EntitySetController and if we send GET request for /Enrollments('<guid id>') it works fine.
  2. When we send GET request to /Enrollments('<guid id>')/Status to fetch just a status of the enrollment, we receive the following error:
{
"odata.error":{
"code":"Not implemented.","message":{
  "lang":"en-US","value":"This service doesn't support OData requests in the form '~/entityset/key/property'."
}
}
}
  1. We have tried to tackle this issue the following way
Created method HttpResponseMessage GetStatus(string key) in the EnrollmentController,
registered Status as an EntitySet (only then it started to work!) in the ODataModelBuilder.

It started to return Status in response to /Enrollments('<guid id>')/Status requests, but when i'm sending request to /Enrollments('<guid id>') the response does not contain Status anymore- just a link to it.


Please advise how to tacke this problem.

Thanks,
Aliaksandr.

Viewing all articles
Browse latest Browse all 7925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>