I generate object with EF and SQL to LINQ, and have complexs types which is returned from stored procedure. Now want to serialize those objects to nested JSON file, by using Newtonsoft json librarys.
The problem which have is that all serialized JSON files are flatten (cause returned result from procedures are all rows), now what want to ask is -
What tehnics to use to get nice structured (nested) JSON automatically (I need to serialize lot of procedure)?
Is there way to configure EF or SQL to LINQ to have functionality like polymorphic associations (like this, but that's old)
Example:
[{"key":value,"key":value,"key":value...}] --> generated JSON
Want get to look like:
{
"key": value,
"key": value,
.
.
.
},
"table1": <------ structured like this
{
"key": value
"key": value
},
"table2":
{
"key": value
"key": value
}
}