deep creates supported?

Oct 14, 2013 at 9:39 AM
Hi guys,

does datajs support deep creates/updates e.g.
create entries with embedded new entries for its navigation properties?

Nov 1, 2013 at 12:03 AM
Hi Joe,

Yes DataJS supports deep inserts/updates.

For example for deep inserting you simply add the related entities payloads in the data property for the request like
 var request =
        headers: Headers,
        requestUri: "MySVC/Employees",
        method: "POST"
        data: { 
                "odata.type": "readWriteSvc.Employee", 
                 ID: 5, Name: "new employee", 
                 Department: {
                     "DID": 10, 
                     "DName": "new Department"
Feb 5, 2014 at 9:39 AM
Edited Feb 5, 2014 at 9:47 AM
Hi thanks,

is it also possible to create 1...n deep entries so if e.g. an employee has more departments?
How should the data be structured?
Must I use arrays?

I ran into problems how to structure the data and also in Atom/XML format it didn't work.