Hi,
I'm writing a service that doesn't use Aurelius but PODO objects.
I have defined the TPatient and TPatientAdditionalData classes.
This is the interface:
type
TPatientGender = (Male, Female, Unknown);
TPatientAdditionalData = class;
TPatient = class(TObject)
private
FName: string;
FAge: Integer;
FSurname: string;
FGender: TPatientGender;
FID: string;
FPatientID: string;
FPatientAdditionalData: TList< TPatientAdditionalData >;
procedure SetAge(const Value: Integer);
procedure SetGender(const Value: TPatientGender);
procedure SetID(const Value: string);
procedure SetName(const Value: string);
procedure SetPatientID(const Value: string);
procedure SetSurname(const Value: string);
function GetPatientAdditionalData: TList< TPatientAdditionalData >;
public
procedure BeforeDestruction; override;
property ID: string read FID write SetID;
property Name: string read FName write SetName;
property Surname: string read FSurname write SetSurname;
property Gender: TPatientGender read FGender write SetGender;
property Age: Integer read FAge write SetAge;
property PatientID: string read FPatientID write SetPatientID;
property PatientAdditionalData: TList< TPatientAdditionalData > read GetPatientAdditionalData;
end;
TPatientAdditionalData = class(TObject)
private
FReferedDoctorName: string;
FAge: Integer;
FQRCodeImage: TMemoryStream;
FQRCodeDecoded: string;
FGPSAddress: string;
FLocalAddress: string;
procedure SetAge(const Value: Integer);
procedure SetGPSAddress(const Value: string);
procedure SetLocalAddress(const Value: string);
procedure SetQRCodeDecoded(const Value: string);
procedure SetQRCodeImage(const Value: TMemoryStream);
procedure SetReferedDoctorName(const Value: string);
public
property ReferedDoctorName: string read FReferedDoctorName write SetReferedDoctorName;
property QRCodeImage: TMemoryStream read FQRCodeImage write SetQRCodeImage;
property QRCodeDecoded: string read FQRCodeDecoded write SetQRCodeDecoded;
property Age: Integer read FAge write SetAge;
property GPSAddress: string read FGPSAddress write SetGPSAddress;
property LocalAddress: string read FLocalAddress write SetLocalAddress;
end;
All compile fine but when i call the Patient resource the server raise this exception;
"EJsonGeneratorNotFound with message "Could not find JSON Generator for type "NativeInt",
The problem is this property of the class TPatient:
property PatientAdditionalData: TList< TPatientAdditionalData > read GetPatientAdditionalData;
which is a generic list of TPatientAdditionalData.
Where am I doing wrong?
Thank you very much and best regards