#1 2019-06-30 10:56:33

Atys
Member
Registered: 2016-04-02
Posts: 13

Record Serialization

Hi all,

How can I ignore some record fields on RecordSaveJSON ?
I'd like to mark some fields not to serialize into the json.

Regards

Offline

#2 2019-06-30 14:29:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,622
Website

Re: Record Serialization

No, it is not possible yet.

Use a class and published properties, if you want to have some unserialized fields.

Offline

#3 2019-06-30 21:16:18

jaclas
Member
Registered: 2014-09-12
Posts: 215

Re: Record Serialization

Try custom record serialization:

SynCommons.TTextWriter.RegisterCustomJSONSerializer(TypeInfo(TSomeRecordType), TSomeRecordCustomWriter.CustomReader, TSomeRecordCustomWriter.CustomWriter);

Offline

#4 2019-07-01 07:43:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,622
Website

Re: Record Serialization

Yes, I forgot about custom serialization.

See https://synopse.info/files/html/Synopse … #TITLE_239

Offline

Board footer

Powered by FluxBB