deep creates supported?

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

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

Oct 31, 2013 at 11:03 PM
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 8:39 AM
Edited Feb 5, 2014 at 8: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.