Expand definition with GetManager.Find< >


Is there a way to expand a specific proxyList using GetManager.Find< > ?
Currently I'm using

TXDataOperationContext.Current.GetManager.ProxyListLoadDepth := 1; // or 2 or more

But in this case it expands all sub objects by proxyList

  1. it can be heavy and long for not useful data
  2. it can expose data without control

Thanks for you help

You can use CreateAlias('MyAssociation', 'a', 'TFetchMode.Eager):


Thanks Wagner

Indeed, it seems to be the right way but unfortunately, I get difficulties to find the right syntax with FetchEager behind a Find<> with Id.


is wrong.
Same with CreateAlias.

What's the right syntax to use in this case?


I found a working syntax but not sure it's the bes

TXDataOperationContext.Current.GetManager.Find<TObject>.CreateAlias('SubObjectList', 'sobj', TFetchMode.Eager).Where(Linq['id_object'] = id_object).UniqueResult);

That is correct.
Note that since you are loading a single object, you could just force the proxy load this way as well:

Object := TXDataOperationContext.Current.GetManager.Find<TObject>(id_object);
Object.SubObject;  //forces loading of SubObject

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.