I have a custom class that implements IResultTransformer.
It is easy to make this work for single values but what is the correct way to setup references if only the id is in the tuple? What if they are supposed to be lazy loaded? Should I just load them from the Session using the Get or Load methods?
For example:
public class FoobarResultTransformer : IResultTransformer
{
public object TransformTuple(object[] tuple, string[] aliases)
{
var foobar = new Foobar();
for (int i = 0; i < aliases.Length; i++)
{
switch(aliases[i])
{
case "IntProperty":
// This one is easy
foobar.IntProperty = Convert.ToInt32(tuple[i]);
break;
case "ReferencedEntityId":
// Assuming the tuple contains a GUID identifier, what should I do here?
foobar.ReferencedEntity =
break;
}
}
return foobar;
}
}