Xdata: Expose proxy key to client when Proxy is lazy loaded

Now if I ask records which have reference with Lazy Proxy like this

    [Association([TAssociationProp.Lazy], CascadeTypeAllButRemove - [TCascadeType.Flush])]
    [JoinColumn('Main', [], 'Id')]
    FMain: proxy< TMain >;

I get output json (11 = id of detail field)
"Main@xdata.proxy": "Detail(11)/Main"
without lazy it's
"Main@xdata.ref": "main(2)"
Where 2 is proper Id of master stored in Detail table
Problem here is that without lazy outer join is generated.

So Add a way to delivery real value stored in table to client when using Lazy proxy. Also add support to XData client so generated object gets the value.

Hi Mika,

Have you tried maybe creating a virtual property using XDataProperty attribute? Something like:


public
  [XDataProperty]
  property MainId: Integer read GetMainId write SetMainId;
...
function TMyClass.GetMainId: Integer;
begin
  Result := FMain.Key;
end;