Show/Hide Toolbars

TMS XData Documentation

Navigation: JSON Format

Collection of Objects

Scroll Prev Top Next More

A collection of objects is represented as JSON array where each element is the representation of an entity or the representation of an entity reference, or representation of any simple object type supported by XData. An empty collection is represented as an empty JSON array.

 

Example of collection of entities with objects inline:

 

[
  {
    "$id": 1,
    "@xdata.type": "XData.Default.Country",
    "Id": 10,
    "Name": "Germany",
  },
  {
    "$id": 2,
    "@xdata.type": "XData.Default.Country",
    "Id": 13,
    "Name": "USA",
  }
]

 

When the server is responding to a request to an entity set resource address or a navigation property that returns an entity collection, or any service operation that returns a list of arbitrary objects, it wraps the collection in a JSON object with a name/value pair named "value":

 

{
  "value": [
    {
      "$id": 1,
      "@xdata.type": "XData.Default.Country",
      "Id": 10,
      "Name": "Germany",
    },
    {
      "$id": 2,
      "@xdata.type": "XData.Default.Country",
      "Id": 13,
      "Name": "USA",
    }
  ]
}