$id, $ref values in branch level.

Jan 27, 2014 at 7:50 PM
Edited Jan 27, 2014 at 7:51 PM
Hello all,

I know this is kind of a big request but I really wanted to have this functionality in Json.NET.

First of all when I am trying to convert some EF objects into JSON, the order of $id value is always the first element and it doesn't matter whether it is an inner object or not, and the outer object gets the $ref value.

My idea is to set this as an option and if the user wants to have the $id value depends on their branch level, the inner children should get the main trunk's $id value as $ref. Otherwise it should be the same. As an example:
1-Question $id:1
  1-a- Response_Group $id:2
    1-a-a-Response $id: 3
1-Response $ref:3
If I want to change this behavior I want to get this:
1-Question $id:1
  1-a- Response_Group $id:2
    1-a-a-Response $ref:3
1-Response $id:3
The upper branch dominates the lower branch.

Is there way to add this request?