Please enable JavaScript to view this site.

Codolex

This activity can be used to convert an entity or list of entities to a JSON string or to a JSON object.

uses System.JSON.TJSONObject

 

clip0036

Activity properties

 

begin

 var JSON: string;

 

var Adapter: ICodolexEntityJSONAdapter<HelpAndManualScreenshots.DataSource.CodolexDatasource.ITask>;

 Adapter := TTaskJSONAdapter.Create;

var JSONObject := Adapter.MapFromEntity(Task);

try

   JSON := JSONObject.Format;

finally

   JSONObject.Free;

end;

end;

resulting code

 

The first return option in this activity is often used to pass an entity from Codolex to another service.

To continue working with JSON in other Delphi code, a JSON object can be created. Please note that this instance is no longer managed by Codolex, and that this must be manually freed.

© by GDK Software