I got two controllers; ProjectController and DocumentController. One project can have several documents.
If I want to get documents by projectid, how and where should that be done using REST? (In general I havent got how REST deals with related data)
Edit: Found MVC Web API, get sub items that might be what I’m looking for.
Ivar
I believe this should be done in the DocumentController. Below is an example
The IQuerable version can be queried using odata filter query. like below:
(you will have to modify the MapHttpRoute to register this route)
The get version (second function) will simply return collection based on the project id.