Have you tried using the three options at the same time? It should work. Note that the xdata-expand-level
header should be set in the request, not in the response.
Alternatively you can force the proxies to be loaded using the manager (setting xdata-expand-level
is still needed):
Result := TXDataOperationContext.Current.GetManager
.Find<TReparateur>
.FetchEager('ReparateurContactList')
.FetchEager('SiteLlist')
.Where(TLinq.Eq('reparateur_id', Id)).UniqueResult;
TXDataOperationContext.Current.Request.Headers.SetValue('xdata-expand-level', '3');
You can always have the option of using DTO objects to fully customize the way you want the response should be.