#1 2014-03-07 14:45:52

dorival
Member
From: Brasil
Registered: 2013-04-17
Posts: 35

using constructor / destrutur in class service

Hello,

I was studying the example project located in "\lib\SQLite3\Samples\20 - DTO based service interface".

I changed TAirportService (of Project20ServerInMemory.dpr) and added constructor and destructor methods.
But when I use the interface on the client side, the constructor and destructor methods are not executed on the server side.
I can not use constructor or destructor in this type of class?
or if I need to use a constructor and destructor have any alternative?

I thank the attention.

Dorival

Offline

#2 2014-03-07 15:48:58

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

Re: using constructor / destrutur in class service

Ensure you inherit your class from TPersistentWithCustomCreate or TInterfacedObjectWithCustomCreate (as defined in mORMot.pas).

Then override the virtual constructor, which will be called as you expect.

Offline

#3 2014-03-07 17:03:07

dorival
Member
From: Brasil
Registered: 2013-04-17
Posts: 35

Re: using constructor / destrutur in class service

cool... It´s work :-)

Thanks AB.

Offline

Board footer

Powered by FluxBB