I have previously made progress on this problem with this post:
The suggestions in this post enabled me to return good JSON into my Browser.
However now I am trying to call the data into an FMX App I am getting an error.
--
[Entity]
[Table('People')]
[Id('FId', TIdGenerator.IdentityOrSequence)]
TPeople = class
private
[Column('ID', [TColumnProp.Required])]
FID: Integer;
... other properties here ...
[XDataProperty]
property Title: string read GetTitle;
end;
--
In my Broswer I call:
http://localhost:2001/xdata/People(25)
and JSON returns:
{
"$id": 1,
"ID": 25,
... other properties
"Title": "Mr"
}
--In FMX I call
var
oPeople: TPeople;
begin
for oPeople in XDataClient.List('$filter=(ID eq 25)') do
...
end
And get the following error:
GExperts Debugger Exception Notification
ExceptionMessage="Title"
ExceptionName="EPropReadOnly"
ExceptionDisplayName="EPropReadOnly"
ExceptionAddress=7FF99DC1543C
FileName=
LineNumber=
ExceptionObject=16B226418D0
Classes=[EPropReadOnly,Exception,TObject]
The application seems to be throwing an exception because of the presence of the property which is not read/write?
Even though the same call works OK returning JSON In the browser.