Follow up question on dealing with Lazy loaded entities. I figured that DevForce knows how to fetch it when data bound.
How do I programmaticaly fetch it? In my case I have SYSDocument which describes document properties. It's child entity is SYSFile - this is table where I store blobs.
User wants to download file and I need to bring this SYSFile to the client. If I just access SYSFile.Data property in code than I get empty byte array (byte[] Data), it's not lazy loaded.
I tried to run code like this but it didn't work either:
var query = documentPlacement.SYSDocument.SYSFile.ToQuery();
query.ExecuteAsync(
op =>
{
if (op.HasError)
{
var aa = op.Error;
}
var a = op.Results;
var b = a;
});
op.Results is empty. I understand that I can write query to fetch it myself. But how do I know that I need to fetch it? SYSDocument.SYSFile is always present (not NULL). How to programmaticaly determine if this entity loaded?