jeudi 17 août 2017

Does Web Api / Newtonsoft.Json handle include parameter

I have created an ASP.Net Web Api application using Entity Framework using the default scaffolding except for setting the ContractResolver to CamelCasePropertyNamesContractResolver() as wanted by Ember-Web-Api.

According to the Ember documentation (http://ift.tt/2krJBUz under Retrieving Related Records) Ember uses the JSON API specification - Inclusion of related resources to return related resources by appending the GET query string with include=relatedResource, eg:

GET /articles/1?include=comments

This should return the article with id=1 and the comments with article_id=1 (article having a 1-n foreign key relationship to comment).

Is there a way tou get Web Api with Entity Framework (From database, foreign keys set up) to return this automatically, or do I need to hand programme an include parameter into every GET method?




Aucun commentaire:

Enregistrer un commentaire