Deserialize TClass from XData to Web Core

You can parse the JSON and use it as a JSON object:

var JsonObject: TJSObject;
...
JsonObject := TJSJson.parseObject(StringJsonReturned);
// then read the properties as JSON:
Name := JS.ToString(JsonObject['Name']);

If you want to strong type it, you can use external classes:


TCustomers = class external name 'Object'
public
  ID: Integer;
  Name: string;
  BranchList: TArray<TCustomerBranch>;
end;

and the same for other classes, then you can simply cast TJSObject to TCustomers:

var Customers: TCustomers;
...
Customers := TCustomers(TJSJson.parseObject(StringJsonReturned));
// then read the properties as object
Name := Customers.Name;